diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-11-20 09:51:47 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-11-20 10:11:54 +0100 |
commit | f208103998cfeffef239c66043184654c00dffda (patch) | |
tree | a9ae027515997dc4b86f85537381d89b6c08bb40 /vcl | |
parent | e58120920f5dd978213ea4387a42ae7e376b2922 (diff) |
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
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/scrbar.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index be571fddb93e..91c17b66fbf5 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -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)); } } |