sc/source/ui/view/gridwin4.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
New commits: commit 63d7f270372c90a8e69f4ce6de48521cde6a784f Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Fri May 13 17:06:19 2022 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue May 17 15:43:40 2022 +0200 lok: respect zoom in calc tile rendering of EditView Issue was that when using 150% zoom in LOK and editing some textbox inside Calc spreadsheet - we didn't see content of it (but tiles were invalidated). In other view we have seen textbox in correct place if zoom was 100%. To fix that we need to pass zoom factor and use it. Change-Id: Ib1cf49af02d0637e09ce68c5c2c41ffb3014c701 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134288 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Mert Tumer <mert.tu...@collabora.com> Reviewed-by: Henry Castro <hcas...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134465 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index c13177e4247d..3677db7122bd 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -731,7 +731,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // the same as editeng and drawinglayer), and get rid of all the // SetMapMode's and other unnecessary fun we have with pixels // See also ScGridWindow::GetDrawMapMode() for the rest of this hack - aDrawMode.SetOrigin(PixelToLogic(Point(nScrX, nScrY), aDrawMode)); + aDrawMode.SetOrigin(PixelToLogic(Point(tools::Long(nScrX / aOutputData.aZoomX), + tools::Long(nScrY / aOutputData.aZoomY)), aDrawMode)); } tools::Rectangle aDrawingRectLogic; bool bLayoutRTL = rDoc.IsLayoutRTL( nTab ); @@ -1036,6 +1037,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI if (bIsTiledRendering) { + const double fZoomX = static_cast<double>(aOutputData.aZoomX); + const double fZoomY = static_cast<double>(aOutputData.aZoomY); + Point aOrigin = aOriginalMode.GetOrigin(); if (bLayoutRTL) aOrigin.setX(-o3tl::convert(aOrigin.getX(), o3tl::Length::twip, o3tl::Length::px) @@ -1047,8 +1051,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI aOrigin.setY(o3tl::convert(aOrigin.getY(), o3tl::Length::twip, o3tl::Length::px) + aOutputData.nScrY); const double twipFactor = 15 * 1.76388889; // 26.45833335 - aOrigin = Point(aOrigin.getX() * twipFactor, - aOrigin.getY() * twipFactor); + aOrigin = Point(aOrigin.getX() * twipFactor / fZoomX, + aOrigin.getY() * twipFactor / fZoomY); MapMode aNew = rDevice.GetMapMode(); aNew.SetOrigin(aOrigin); rDevice.SetMapMode(aNew); @@ -1600,7 +1604,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, -nTopLeftTileRowOffset, nTopLeftTileCol, nTopLeftTileRow, nBottomRightTileCol, nBottomRightTileRow, - fPPTX, fPPTY, nullptr, nullptr); + fPPTX, fPPTY, &aFracX, &aFracY); // setup the SdrPage so that drawinglayer works correctly ScDrawLayer* pModel = rDoc.GetDrawLayer();