Kaydet (Commit) d6fe9289 authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Andras Timar

rendercontext: Fix painting of double-buffered spinboxes.

Change-Id: I8cd2275d2607559c283d84d66b6d1f0588944cbe
üst 7f9a8f55
...@@ -93,18 +93,26 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW ...@@ -93,18 +93,26 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW
Rectangle aClipRect(rSpinbuttonValue.maLowerRect); Rectangle aClipRect(rSpinbuttonValue.maLowerRect);
aClipRect.Union(rSpinbuttonValue.maUpperRect); aClipRect.Union(rSpinbuttonValue.maUpperRect);
// convert from screen space to borderwin space vcl::RenderContext* pContext = &rRenderContext;
aClipRect.SetPos(pBorder->ScreenToOutputPixel(pWin->OutputToScreenPixel(aClipRect.TopLeft()))); vcl::Region oldRgn;
vcl::Region oldRgn(pBorder->GetClipRegion());
pBorder->SetClipRegion(vcl::Region(aClipRect));
Point aPt; Point aPt;
Size aSize(pBorder->GetOutputSizePixel()); // the size of the border window, i.e., the whole control Size aSize(pBorder->GetOutputSizePixel()); // the size of the border window, i.e., the whole control
Rectangle aBound, aContent;
Rectangle aNatRgn(aPt, aSize); Rectangle aNatRgn(aPt, aSize);
if (!pWin->SupportsDoubleBuffering())
{
// convert from screen space to borderwin space
aClipRect.SetPos(pBorder->ScreenToOutputPixel(pWin->OutputToScreenPixel(aClipRect.TopLeft())));
oldRgn = pBorder->GetClipRegion();
pBorder->SetClipRegion(vcl::Region(aClipRect));
pContext = pBorder;
}
Rectangle aBound, aContent;
if (!ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize && if (!ImplGetSVData()->maNWFData.mbCanDrawWidgetAnySize &&
pBorder->GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL, pContext->GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL,
aNatRgn, ControlState::NONE, rSpinbuttonValue, aNatRgn, ControlState::NONE, rSpinbuttonValue,
OUString(), aBound, aContent)) OUString(), aBound, aContent))
{ {
...@@ -112,10 +120,17 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW ...@@ -112,10 +120,17 @@ bool ImplDrawNativeSpinfield(vcl::RenderContext& rRenderContext, vcl::Window* pW
} }
Rectangle aRgn(aPt, aSize); Rectangle aRgn(aPt, aSize);
bNativeOK = pBorder->DrawNativeControl(CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, if (pWin->SupportsDoubleBuffering())
{
// convert from borderwin space, to the pWin's space
aRgn.SetPos(pWin->ScreenToOutputPixel(pBorder->OutputToScreenPixel(aRgn.TopLeft())));
}
bNativeOK = pContext->DrawNativeControl(CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn,
ControlState::ENABLED, rSpinbuttonValue, OUString()); ControlState::ENABLED, rSpinbuttonValue, OUString());
pBorder->SetClipRegion(vcl::Region(oldRgn)); if (!pWin->SupportsDoubleBuffering())
pBorder->SetClipRegion(vcl::Region(oldRgn));
} }
} }
return bNativeOK; return bNativeOK;
......
...@@ -753,7 +753,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, s ...@@ -753,7 +753,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, s
if ((aCtrlType == CTRL_SPINBOX) && !pCtrl->IsNativeControlSupported(CTRL_SPINBOX, PART_BUTTON_UP)) if ((aCtrlType == CTRL_SPINBOX) && !pCtrl->IsNativeControlSupported(CTRL_SPINBOX, PART_BUTTON_UP))
{ {
Edit* pEdit = static_cast<Edit*>(pCtrl)->GetSubEdit(); Edit* pEdit = static_cast<Edit*>(pCtrl)->GetSubEdit();
if (pEdit) if (pEdit && !pEdit->SupportsDoubleBuffering())
pCtrl->Paint(*pCtrl, Rectangle()); // make sure the buttons are also drawn as they might overwrite the border pCtrl->Paint(*pCtrl, Rectangle()); // make sure the buttons are also drawn as they might overwrite the border
} }
} }
......
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