[Libreoffice-commits] core.git: svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 28 18:29:51 UTC 2020
svx/source/tbxctrls/tbxcolorupdate.cxx | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
New commits:
commit cfc76db4318cd91ce69350d5214f80b2d6d5b1db
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 28 12:13:55 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 28 20:29:09 2020 +0200
tdf#135121 don't paint the image over the rect that will contain the color
so that for the transparent color case we remain showing the original
background and not that part of the icon
Change-Id: I20452c7eccf141fdbede9ed2476270315963022e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99589
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index f716a4e1f7c9..7c2b3bd656a7 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();
@@ -195,12 +212,6 @@ namespace svx
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());
More information about the Libreoffice-commits
mailing list