summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbxcolorupdate.cxx25
1 files changed, 18 insertions, 7 deletions
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index f84cda150837..e1920affc11e 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -171,8 +171,25 @@ namespace svx
pVirDev->SetOutputSizePixel(aItemSize);
maBmpSize = aItemSize;
+ if (maBmpSize.Width() == maBmpSize.Height())
+ // tdf#84985 align color bar with icon bottom edge; integer arithmetic e.g. 26 - 26/4 <> 26 * 3/4
+ maUpdRect = tools::Rectangle(Point( 0, maBmpSize.Height() - maBmpSize.Height() / 4), Size(maBmpSize.Width(), maBmpSize.Height() / 4));
+ else
+ maUpdRect = tools::Rectangle(Point( maBmpSize.Height() + 2, 2), Point(maBmpSize.Width() - 3, maBmpSize.Height() - 3));
+
+ pVirDev->Push(PushFlags::CLIPREGION);
+
+ // tdf#135121 don't include the part of the image which we will
+ // overwrite with the target color so that for the transparent color
+ // case the original background of the device is shown
+ vcl::Region aRegion(tools::Rectangle(Point(0, 0), maBmpSize));
+ aRegion.Exclude(maUpdRect);
+ pVirDev->SetClipRegion(aRegion);
+
pVirDev->DrawImage(Point(0, 0), aImage);
+ pVirDev->Pop();
+
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
mbWasHiContrastMode = rStyleSettings.GetHighContrastMode();
@@ -188,19 +205,13 @@ namespace svx
if (bIsTransparent)
{
- pVirDev->SetFillColor(Color(255, 0, 0, 0));
+ pVirDev->SetFillColor();
}
else
{
pVirDev->SetFillColor(maCurColor);
}
- if (maBmpSize.Width() == maBmpSize.Height())
- // tdf#84985 align color bar with icon bottom edge; integer arithmetic e.g. 26 - 26/4 <> 26 * 3/4
- maUpdRect = tools::Rectangle(Point( 0, maBmpSize.Height() - maBmpSize.Height() / 4), Size(maBmpSize.Width(), maBmpSize.Height() / 4));
- else
- maUpdRect = tools::Rectangle(Point( maBmpSize.Height() + 2, 2), Point(maBmpSize.Width() - 3, maBmpSize.Height() - 3));
-
pVirDev->DrawRect(maUpdRect);
SetImage(pVirDev.get());