Kaydet (Commit) 30b511ae authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 7ce0889e
......@@ -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)));
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment