summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2015-01-16 17:45:52 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2015-01-16 17:50:29 -0500
commit88562ee6e352b5446bb55e906e8f1c2f34035a49 (patch)
tree09c015c8b137e818627b8e25cafcc671aca2514a /sc
parent7fb400c886f59fb75274213af4374798b44f04dd (diff)
Get texts to scale correctly with zoom.
We need to set scaling factors to device's map mode *only* for the texts. Calc handles scaling for all the rest. Interesting how it works. Change-Id: Ia6aa122961ea5ddc2e31eacb28392f3e355a5ebf
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin4.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a8abe26b87db..5e364c2a197b 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -935,10 +935,20 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
aOutData.DrawShadow();
aOutData.DrawFrame();
- // TODO : Scaling of strings is incorrect. Find out why.
+ // Set scaling to map mode only for text rendering, to get texts to scale
+ // correctly.
+ MapMode aOldMapMode = rDevice.GetMapMode();
+ MapMode aNewMapMode = aOldMapMode;
+ aNewMapMode.SetScaleX(aFracX);
+ aNewMapMode.SetScaleY(aFracY);
+ rDevice.SetMapMode(aNewMapMode);
+
aOutData.DrawStrings(true);
+
// TODO : Edit texts don't get rendered at all. Fix this.
aOutData.DrawEdit(true);
+
+ rDevice.SetMapMode(aOldMapMode);
}
void ScGridWindow::CheckNeedsRepaint()