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

sw lok comments: fix comment widget width with custom zoom

When tiled rendering, then only the render context (or failing that,
SwViewShell::GetOut()) has the correct zoom level, so use that when
doing pixel-to-logic conversion or scaling pixel values.

Change-Id: I265a642b8253c6eced42da2a0e06a2de25c36ca8
üst c2d7b586
......@@ -870,7 +870,7 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext, const Rectangle& /*rRe
MapMode aMapMode(rRenderContext.GetMapMode());
aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
rRenderContext.SetMapMode(aMapMode);
Size aSize(pPostIt->PixelToLogic(pPostIt->GetSizePixel()));
Size aSize(rRenderContext.PixelToLogic(pPostIt->GetSizePixel()));
Rectangle aRectangle(Point(0, 0), aSize);
pPostIt->PaintTile(rRenderContext, aRectangle);
......
......@@ -285,7 +285,8 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
continue;
rRenderContext.Push(PushFlags::MAPMODE);
Point aOffset(PixelToLogic(pChild->GetPosPixel()));
const Fraction& rFraction(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
Point aOffset(PixelToLogic(pChild->GetPosPixel() * rFraction.GetDenominator() / rFraction.GetNumerator()));
MapMode aMapMode(rRenderContext.GetMapMode());
aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
rRenderContext.SetMapMode(aMapMode);
......@@ -1402,7 +1403,7 @@ sal_Int32 SwSidebarWin::GetMetaButtonAreaWidth()
sal_Int32 SwSidebarWin::GetMetaHeight()
{
const Fraction& f( GetMapMode().GetScaleY() );
const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
return POSTIT_META_HEIGHT * f.GetNumerator() / f.GetDenominator();
}
......@@ -1413,7 +1414,7 @@ sal_Int32 SwSidebarWin::GetMinimumSizeWithMeta()
sal_Int32 SwSidebarWin::GetMinimumSizeWithoutMeta()
{
const Fraction& f( GetMapMode().GetScaleY() );
const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
return POSTIT_MINIMUMSIZE_WITHOUT_META * f.GetNumerator() / f.GetDenominator();
}
......
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