[Libreoffice-commits] core.git: cppcanvas/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 5 23:27:34 UTC 2018


 cppcanvas/source/mtfrenderer/mtftools.cxx |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

New commits:
commit fff34169fa912ad5096f1652172ea2455e5cb4d3
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Sun Nov 4 18:11:51 2018 +0800
Commit:     Mark Hung <marklh9 at gmail.com>
CommitDate: Tue Nov 6 00:15:09 2018 +0100

    tdf#70851 fix strange waveline polygon.
    
    ::basegfx::utils::createWaveline was invoked with incorrect
    parameter, resulted in wavelines rendered along a 4-sided
    rectangle instead of a line.
    
    Change-Id: I30f52c95bdb4f804438b04559ba339ba95dee6e1
    Reviewed-on: https://gerrit.libreoffice.org/62838
    Tested-by: Jenkins
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx
index 1d60ed157927..7b051ef2c5d4 100644
--- a/cppcanvas/source/mtfrenderer/mtftools.cxx
+++ b/cppcanvas/source/mtfrenderer/mtftools.cxx
@@ -265,10 +265,7 @@ namespace cppcanvas
                              sal_Int8                   nLineStyle)
             {
                 const double x(rStartPos.getX());
-                const double y(rStartPos.getY());
-                const double nY1 = y + nStartOffset;
-                const double nX2 = x + nWidth;
-                const double nY2 = nY1 + nHeight;
+                const double y(rStartPos.getY() + nStartOffset + nHeight);
                 double nWaveWidth = nHeight * 10.6 * 0.25;
                 // Offset for the double line.
                 double nOffset = 0.0;
@@ -278,18 +275,20 @@ namespace cppcanvas
                 else
                     nWaveWidth *= 2.0;
 
-                o_rPoly.append(::basegfx::utils::createWaveline(
-                            ::basegfx::utils::createPolygonFromRect(::basegfx::B2DRectangle(x, nY1 + nOffset, nX2, nY2 + nOffset)),
-                            nWaveWidth,
-                            nWaveWidth * 0.5));
+                basegfx::B2DPolygon aLine;
+                aLine.append(basegfx::B2DPoint(x, y + nOffset));
+                aLine.append(basegfx::B2DPoint(x + nWidth, y + nOffset));
+
+                o_rPoly.append(::basegfx::utils::createWaveline(aLine, nWaveWidth, nWaveWidth * 0.5));
 
                 if (nLineStyle == LINESTYLE_DOUBLEWAVE)
                 {
                     nOffset = nHeight * 1.2;
-                    o_rPoly.append(::basegfx::utils::createWaveline(
-                                ::basegfx::utils::createPolygonFromRect(::basegfx::B2DRectangle(x, nY1 + nOffset, nX2, nY2 + nOffset)),
-                                nWaveWidth,
-                                nWaveWidth * 0.5));
+
+                    basegfx::B2DPolygon aLine2;
+                    aLine2.append(basegfx::B2DPoint(x, y + nOffset));
+                    aLine2.append(basegfx::B2DPoint(x + nWidth, y + nOffset));
+                    o_rPoly.append(::basegfx::utils::createWaveline(aLine2, nWaveWidth, nWaveWidth * 0.5));
                 }
             }
 


More information about the Libreoffice-commits mailing list