summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-23 13:46:59 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-23 13:47:32 +0100
commit30b511ae38e2870174db91d12f65a9c3320fc172 (patch)
tree316e87450c515487f1e6f7ea01102fb03cfc9720 /sw
parent7ce0889ec9a87198560fa39afbae282938e0a9d9 (diff)
sw lok comments: fix vertical scrollbar with custom zoom
With this, if a comment has enough content that it gets a vertical scrollbar, then tiled rendering output looks OK, even with non-100% zoom. Change-Id: I699aadc11b6c34fb0791e70705719fd61169d972
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/view/viewsh.cxx9
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx5
2 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index bf919a97f623..c45fd29b9672 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1881,6 +1881,15 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
aMapMode.SetScaleY(scaleY);
rDevice.SetMapMode(aMapMode);
+ // Update scaling of SwEditWin and its sub-widgets, needed for comments.
+ if (GetWin() && GetWin()->GetMapMode().GetScaleX() != scaleX)
+ {
+ double fScale = scaleX;
+ SwViewOption aOption(*GetViewOptions());
+ aOption.SetZoom(fScale * 100);
+ ApplyViewOptions(aOption);
+ }
+
Rectangle aOutRect = Rectangle(Point(tilePosX, tilePosY),
rDevice.PixelToLogic(Size(contextWidth, contextHeight)));
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 394fcbe40d6e..0891a2af5abd 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -283,8 +283,7 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
continue;
rRenderContext.Push(PushFlags::MAPMODE);
- const Fraction& rFraction(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
- Point aOffset(PixelToLogic(pChild->GetPosPixel() * rFraction.GetDenominator() / rFraction.GetNumerator()));
+ Point aOffset(PixelToLogic(pChild->GetPosPixel()));
MapMode aMapMode(rRenderContext.GetMapMode());
aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
rRenderContext.SetMapMode(aMapMode);
@@ -298,6 +297,8 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
pChild->EnableMapMode();
aMapMode = pChild->GetMapMode();
aMapMode.SetMapUnit(rRenderContext.GetMapMode().GetMapUnit());
+ aMapMode.SetScaleX(rRenderContext.GetMapMode().GetScaleX());
+ aMapMode.SetScaleY(rRenderContext.GetMapMode().GetScaleY());
pChild->SetMapMode(aMapMode);
}