diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2020-03-15 11:56:59 +0100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2020-03-15 15:26:03 +0100 |
commit | 87c2d3a3d9d91c18ff8c32760a3c34a99c629c1a (patch) | |
tree | 644495683137d4c4c05c3ae8464203f0184710cb /drawinglayer/source/tools | |
parent | 28411a70596841a974343be5696320aaaad8dae8 (diff) |
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@poczta.onet.pl>
Diffstat (limited to 'drawinglayer/source/tools')
-rw-r--r-- | drawinglayer/source/tools/emfpbrush.cxx | 2 | ||||
-rw-r--r-- | drawinglayer/source/tools/emfphelperdata.cxx | 31 |
2 files changed, 26 insertions, 7 deletions
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 |