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

vcl ScrollBar: audit Draw*() calls in ImplDraw()

These member functions take logic units, and the only case when omitting
PixelToLogic() all the time works is when both the widget itself and
render context has a pixel map unit.

Add missing PixelToLogic() calls where the input is in pixels, so in
case the render context has some logic units, the output is still
painted at the correct location.

This is needed for e.g. tiled rendering of the scrollbar of Writer
comment widgets.

Change-Id: Ideb75625b1f6349c5f18342e6f438fd5d7c31dcd
(cherry picked from commit f2081039)
üst 70449a45
......@@ -655,7 +655,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla
nStyle = DrawButtonFlags::NoLightBorder;
if (mnStateFlags & SCRBAR_STATE_BTN1_DOWN)
nStyle |= DrawButtonFlags::Pressed;
aTempRect = aDecoView.DrawButton( maBtn1Rect, nStyle );
aTempRect = aDecoView.DrawButton( PixelToLogic(maBtn1Rect), nStyle );
ImplCalcSymbolRect( aTempRect );
DrawSymbolFlags nSymbolStyle = DrawSymbolFlags::NONE;
if ((mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) || !bEnabled)
......@@ -682,7 +682,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla
nStyle = DrawButtonFlags::NoLightBorder;
if (mnStateFlags & SCRBAR_STATE_BTN2_DOWN)
nStyle |= DrawButtonFlags::Pressed;
aTempRect = aDecoView.DrawButton(maBtn2Rect, nStyle);
aTempRect = aDecoView.DrawButton(PixelToLogic(maBtn2Rect), nStyle);
ImplCalcSymbolRect(aTempRect);
DrawSymbolFlags nSymbolStyle = DrawSymbolFlags::NONE;
if ((mnStateFlags & SCRBAR_STATE_BTN2_DISABLE) || !bEnabled)
......@@ -713,12 +713,12 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla
if (bEnabled)
{
nStyle = DrawButtonFlags::NoLightBorder;
aTempRect = aDecoView.DrawButton(maThumbRect, nStyle);
aTempRect = aDecoView.DrawButton(PixelToLogic(maThumbRect), nStyle);
}
else
{
rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
rRenderContext.DrawRect(maThumbRect);
rRenderContext.DrawRect(PixelToLogic(maThumbRect));
}
}
}
......@@ -729,7 +729,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla
rRenderContext.SetFillColor(rStyleSettings.GetShadowColor());
else
rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
rRenderContext.DrawRect(maPage1Rect);
rRenderContext.DrawRect(PixelToLogic(maPage1Rect));
}
if ((nDrawFlags & SCRBAR_DRAW_PAGE2) && (!ImplDrawNative(rRenderContext, SCRBAR_DRAW_PAGE2)))
{
......@@ -737,7 +737,7 @@ void ScrollBar::ImplDraw(vcl::RenderContext& rRenderContext, sal_uInt16 nDrawFla
rRenderContext.SetFillColor(rStyleSettings.GetShadowColor());
else
rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
rRenderContext.DrawRect(maPage2Rect);
rRenderContext.DrawRect(PixelToLogic(maPage2Rect));
}
}
......
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