summaryrefslogtreecommitdiff
path: root/cppcanvas/source
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-11-04 18:11:51 +0800
committerMark Hung <marklh9@gmail.com>2018-11-06 00:15:09 +0100
commitfff34169fa912ad5096f1652172ea2455e5cb4d3 (patch)
tree97f2e6b0b60c40716048995349d73fe873c04920 /cppcanvas/source
parent6896f39ffd8a6c4b32b8f601a6a93678247456bd (diff)
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@gmail.com>
Diffstat (limited to 'cppcanvas/source')
-rw-r--r--cppcanvas/source/mtfrenderer/mtftools.cxx23
1 files changed, 11 insertions, 12 deletions
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));
}
}