diff options
Diffstat (limited to 'vcl/source/window/floatwin.cxx')
-rw-r--r-- | vcl/source/window/floatwin.cxx | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 302703bf4e8a..8a5d5dcc62fd 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -445,13 +445,22 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, if (bLOKActive && pLOKTwipsPos) { - // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)), - // when map mode is not enabled, we gets a 20 twips per pixel conversion - // since LogicToLogic uses a fixed 72 dpi value, instead of a correctly - // computed output device dpi or at least the most commonly used 96 dpi - // value; and anyway the following is what we already do in - // ScGridWindow::LogicInvalidate when map mode is not enabled. - *pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); + if (pW->IsMapModeEnabled() || pW->GetMapMode().GetMapUnit() == MapUnit::MapPixel) + { + // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)), + // for pixel conversions when map mode is not enabled, we gets + // a 20 twips per pixel conversion since LogicToLogic uses + // a fixed 72 dpi value, instead of a correctly computed output + // device dpi or at least the most commonly used 96 dpi value; + // and anyway the following is what we already do in + // ScGridWindow::LogicInvalidate when map mode is not enabled. + + *pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); + } + else + { + *pLOKTwipsPos = pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); + } } // caller expects coordinates relative to top-level win |