summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2019-12-10 10:57:32 +0100
committerAndras Timar <andras.timar@collabora.com>2020-02-10 23:26:35 +0100
commit2b7f4d8a2cfad9fab557762cc8cfbdb2d41b9938 (patch)
tree309943c5297cdd469c5a7560c3f81ef1a17cc1e8 /sc/source
parent6a1afa08131bb621cac9a350786b2e41d10afef3 (diff)
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@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/view/gridwin4.cxx11
1 files changed, 7 insertions, 4 deletions
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);