diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-26 10:35:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-26 12:13:04 +0200 |
commit | 2b3dcd24e4da1f83bfaf8e0ffd93839eeae621b0 (patch) | |
tree | ae52ec8609eb3b1bc16ce8599577438982c9b409 /vcl | |
parent | 6a51ab527b56ddc2bf6ec6ccbfbf2bc608244355 (diff) |
Revert "simplify logic in FloatingWindow::ImplCalcPos"
This reverts commit ea3317188589554ea5773db53aa9e0cc88bee271.
Reason for revert: There are 3 different coordinate systems at work here, not 2, my mistake.
Change-Id: Iee69b8ba3c2fe60b26b118e79116035be42c6c45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154922
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/floatwin.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index aa3abb3ec16b..3aff8ef400c0 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -445,6 +445,8 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, rArrangeIndex = nArrangeIndex; + aPos = pW->AbsoluteScreenToOutputPixel( aPos ); + // store a cliprect that can be used to clip the common edge of the itemrect and the floating window if( pFloatingWindow && pFloatingWindow->mpImplData->mpBox ) { @@ -454,8 +456,6 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, if (bLOKActive && pLOKTwipsPos) { - Point aPosOut = pW->AbsoluteScreenToOutputPixel( aPos ); - if (pW->IsMapModeEnabled() || pW->GetMapMode().GetMapUnit() == MapUnit::MapPixel) { // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)), @@ -466,16 +466,16 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, // and anyway the following is what we already do in // ScGridWindow::LogicInvalidate when map mode is not enabled. - *pLOKTwipsPos = pW->PixelToLogic(aPosOut, MapMode(MapUnit::MapTwip)); + *pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); } else { - *pLOKTwipsPos = OutputDevice::LogicToLogic(aPosOut, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); + *pLOKTwipsPos = OutputDevice::LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); } } // caller expects coordinates relative to top-level win - return aPos; + return pW->OutputToScreenPixel( aPos ); } Point FloatingWindow::ImplConvertToAbsPos(vcl::Window* pReference, const Point& rPos) |