summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-05-13 17:06:19 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2022-05-17 15:43:40 +0200
commit63d7f270372c90a8e69f4ce6de48521cde6a784f (patch)
treec63b2e21b6453ffcdd316c7528f15b87ce3718fa /sc
parent268443a55340bf9d106fef870827bd2cff06f7ee (diff)
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134465 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin4.cxx12
1 files changed, 8 insertions, 4 deletions
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();