[Libreoffice-commits] core.git: drawinglayer/source
Bartosz Kosiorek (via logerrit)
logerrit at kemper.freedesktop.org
Sun Mar 15 14:26:35 UTC 2020
drawinglayer/source/tools/emfpbrush.cxx | 2 -
drawinglayer/source/tools/emfphelperdata.cxx | 31 +++++++++++++++++++++------
2 files changed, 26 insertions(+), 7 deletions(-)
New commits:
commit 87c2d3a3d9d91c18ff8c32760a3c34a99c629c1a
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Sun Mar 15 11:56:59 2020 +0100
Commit: Bartosz Kosiorek <gang65 at poczta.onet.pl>
CommitDate: Sun Mar 15 15:26:03 2020 +0100
tdf#124424 Fix WrapModeTileFlipY option for LinearGradient
Change-Id: I61a533d2fab085992c1507331699b78aca2c8d29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90515
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
diff --git a/drawinglayer/source/tools/emfpbrush.cxx b/drawinglayer/source/tools/emfpbrush.cxx
index f4e57015ca72..ca0c27b23ecf 100644
--- a/drawinglayer/source/tools/emfpbrush.cxx
+++ b/drawinglayer/source/tools/emfpbrush.cxx
@@ -246,7 +246,7 @@ namespace emfplushelper
case BrushTypeLinearGradient:
{
s.ReadUInt32(additionalFlags).ReadInt32(wrapMode);
- SAL_INFO("drawinglayer", "EMF+\t\t\t\tLinear gradient, additional flags: 0x" << std::hex << additionalFlags << std::dec);
+ SAL_INFO("drawinglayer", "EMF+\t\t\t\tLinear gradient, additional flags: 0x" << std::hex << additionalFlags << std::dec << ", wrapMode: " << wrapMode);
s.ReadFloat(firstPointX).ReadFloat(firstPointY).ReadFloat(aWidth).ReadFloat(aHeight);
SAL_INFO("drawinglayer", "EMF+\t\t\t\tFirst gradient point: " << firstPointX << ":" << firstPointY
<< ", size " << aWidth << "x" << aHeight);
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 209063586d62..f7c22c6831b6 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -54,6 +54,16 @@
namespace emfplushelper
{
+
+ enum
+ {
+ WrapModeTile = 0x00000000,
+ WrapModeTileFlipX = 0x00000001,
+ WrapModeTileFlipY = 0x00000002,
+ WrapModeTileFlipXY = 0x00000003,
+ WrapModeClamp = 0x00000004
+ };
+
const char* emfTypeToName(sal_uInt16 type)
{
switch (type)
@@ -788,7 +798,7 @@ namespace emfplushelper
{
if (brush->type == BrushTypePathGradient && !(brush->additionalFlags & 0x1))
{
- SAL_WARN("drawinglayer", "EMF+\t TODO Verify proper displaying of BrushTypePathGradient with flags: " << std::hex << brush->additionalFlags << std::dec);
+ SAL_WARN("drawinglayer", "EMF+\t TODO Implement displaying BrushTypePathGradient with Boundary: ");
}
::basegfx::B2DHomMatrix aTextureTransformation;
@@ -887,11 +897,20 @@ namespace emfplushelper
drawinglayer::primitive2d::SpreadMethod aSpreadMethod(drawinglayer::primitive2d::SpreadMethod::Pad);
switch(brush->wrapMode)
{
- case 0 : aSpreadMethod = drawinglayer::primitive2d::SpreadMethod::Repeat; break;
- case 1 :
- case 2 :
- case 3 : aSpreadMethod = drawinglayer::primitive2d::SpreadMethod::Reflect; break;
- default: break;
+ case WrapModeTile:
+ case WrapModeTileFlipY:
+ {
+ aSpreadMethod = drawinglayer::primitive2d::SpreadMethod::Repeat;
+ break;
+ }
+ case WrapModeTileFlipX:
+ case WrapModeTileFlipXY:
+ {
+ aSpreadMethod = drawinglayer::primitive2d::SpreadMethod::Reflect;
+ break;
+ }
+ default:
+ break;
}
// create the same one used for SVG
More information about the Libreoffice-commits
mailing list