Kaydet (Commit) f2081039 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
üst e5812092
......@@ -637,7 +637,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)
......@@ -664,7 +664,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)
......@@ -695,12 +695,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));
}
}
}
......@@ -711,7 +711,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)))
{
......@@ -719,7 +719,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