[Libreoffice-commits] core.git: sc/source
Marco Cecchetti (via logerrit)
logerrit at kemper.freedesktop.org
Mon Feb 10 22:27:11 UTC 2020
sc/source/ui/view/gridwin4.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 2b7f4d8a2cfad9fab557762cc8cfbdb2d41b9938
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Tue Dec 10 10:57:32 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Feb 10 23:26:35 2020 +0100
lok: calc: zoomed text entry not rendered
Change-Id: I829966d81bd68571a0651feb458a817587e4d88e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84992
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 8fb7ca7853de..4232223fb79d 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -968,8 +968,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
rDevice.SetMapMode(aDrawMode);
static const double twipFactor = 15 * 1.76388889; // 26.45833335
- aOrigin = Point(aOrigin.getX() * twipFactor,
- aOrigin.getY() * twipFactor);
+ // keep into account the zoom factor
+ aOrigin = Point((aOrigin.getX() * twipFactor) / static_cast<double>(aDrawMode.GetScaleX()),
+ (aOrigin.getY() * twipFactor) / static_cast<double>(aDrawMode.GetScaleY()));
+
MapMode aNew = rDevice.GetMapMode();
aNew.SetOrigin(aOrigin);
rDevice.SetMapMode(aNew);
@@ -1040,8 +1042,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX);
aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY);
static const double twipFactor = 15 * 1.76388889; // 26.45833335
- aOrigin = Point(aOrigin.getX() * twipFactor,
- aOrigin.getY() * twipFactor);
+ // keep into account the zoom factor
+ aOrigin = Point((aOrigin.getX() * twipFactor) / static_cast<double>(aDrawMode.GetScaleX()),
+ (aOrigin.getY() * twipFactor) / static_cast<double>(aDrawMode.GetScaleY()));
MapMode aNew = rDevice.GetMapMode();
aNew.SetOrigin(aOrigin);
rDevice.SetMapMode(aNew);
More information about the Libreoffice-commits
mailing list