Kaydet (Commit) fff34169 authored tarafından Mark Hung's avatar Mark Hung

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: 's avatarMark Hung <marklh9@gmail.com>
üst 6896f39f
......@@ -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));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment