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
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a8abe26..5e364c2 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()