Kaydet (Commit) 57266334 authored tarafından Bartosz Kosiorek's avatar Bartosz Kosiorek

tdf#39053 EMF+ Draw an extra line between the last point and the first point.

The EmfPlusDrawlLines record specifies drawing a series of connected lines.
Bit 0x2000 indicates whether to draw an extra line between the last point
and the first point, to close the shape.
In this commit support of additional line which close shape was added.

Change-Id: I47ae3d8003cbfdd5b8ff5ba78e1ebe10f97af04b
Reviewed-on: https://gerrit.libreoffice.org/36317Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarBartosz Kosiorek <gang65@poczta.onet.pl>
üst fcb32f1c
......@@ -1066,7 +1066,9 @@ namespace cppcanvas
EMFPPath path (points, true);
path.Read (rMF, flags, *this);
EMFPPlusDrawPolygon (path.GetPolygon (*this), rFactoryParms, rState, rCanvas, flags);
// 0x2000 bit indicates whether to draw an extra line between the last point
// and the first point, to close the shape.
EMFPPlusDrawPolygon (path.GetPolygon (*this, true, (flags & 0x2000)), rFactoryParms, rState, rCanvas, flags);
break;
}
......
......@@ -105,7 +105,7 @@ namespace cppcanvas
#endif
}
::basegfx::B2DPolyPolygon& EMFPPath::GetPolygon (ImplRenderer& rR, bool bMapIt)
::basegfx::B2DPolyPolygon& EMFPPath::GetPolygon (ImplRenderer& rR, bool bMapIt, bool bAddLineToCloseShape)
{
::basegfx::B2DPolygon polygon;
......@@ -157,7 +157,13 @@ namespace cppcanvas
polygon.clear ();
}
}
// Draw an extra line between the last point and the first point, to close the shape.
if (bAddLineToCloseShape) {
if (bMapIt)
polygon.append (rR.Map (pPoints [0], pPoints [1]) );
else
polygon.append (::basegfx::B2DPoint (pPoints [0], pPoints [1]) );
}
if (polygon.count ()) {
aPolygon.append (polygon);
......
......@@ -38,7 +38,7 @@ namespace cppcanvas
// TODO: remove rR argument when debug code is not longer needed
void Read(SvStream& s, sal_uInt32 pathFlags, ImplRenderer& rR);
::basegfx::B2DPolyPolygon& GetPolygon(ImplRenderer& rR, bool bMapIt = true);
::basegfx::B2DPolyPolygon& GetPolygon(ImplRenderer& rR, bool bMapIt = true, bool bAddLineToCloseShape = false);
};
}
}
......
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