summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-01-17 16:54:04 +0000
committerArmin Le Grand <alg@apache.org>2012-01-17 16:54:04 +0000
commit2a0cd925bebb0c7d3513db311b185a04f259b68d (patch)
tree8d1ed154b241a9823c54b76ed091ecb6b6935a9d /svgio
parent63480c993d8e2fb0929d3c39f621aae9443faa04 (diff)
linecap: Reintegrating finished LineCap feature, kudos to Regina Henschel for doing the basic implementation and offering it under apache license
Notes
Notes: merged as: 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70
Diffstat (limited to 'svgio')
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx29
1 files changed, 26 insertions, 3 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index d43a9fbad55d..b8b6c369a501 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -63,6 +63,28 @@ namespace svgio
return basegfx::B2DLINEJOIN_MITER;
}
+ com::sun::star::drawing::LineCap StrokeLinecapToDrawingLineCap(StrokeLinecap aStrokeLinecap)
+ {
+ switch(aStrokeLinecap)
+ {
+ default: /* StrokeLinecap_notset, StrokeLinecap_butt */
+ {
+ return com::sun::star::drawing::LineCap_BUTT;
+ break;
+ }
+ case StrokeLinecap_round:
+ {
+ return com::sun::star::drawing::LineCap_ROUND;
+ break;
+ }
+ case StrokeLinecap_square:
+ {
+ return com::sun::star::drawing::LineCap_SQUARE;
+ break;
+ }
+ }
+ }
+
FontStretch getWider(FontStretch aSource)
{
switch(aSource)
@@ -658,8 +680,9 @@ namespace svgio
if(basegfx::fTools::more(fStrokeWidth, 0.0))
{
- // get LineJoin and stroke array
+ // get LineJoin, LineCap and stroke array
const basegfx::B2DLineJoin aB2DLineJoin(StrokeLinejoinToB2DLineJoin(getStrokeLinejoin()));
+ const com::sun::star::drawing::LineCap aLineCap(StrokeLinecapToDrawingLineCap(getStrokeLinecap()));
::std::vector< double > aDashArray;
if(!getStrokeDasharray().empty())
@@ -668,14 +691,14 @@ namespace svgio
}
// todo: Handle getStrokeDashOffset()
- // todo: Handle getStrokeLinecap()
// prepare line attribute
drawinglayer::primitive2d::Primitive2DReference aNewLinePrimitive;
const drawinglayer::attribute::LineAttribute aLineAttribute(
pStroke ? *pStroke : basegfx::BColor(0.0, 0.0, 0.0),
fStrokeWidth,
- aB2DLineJoin);
+ aB2DLineJoin,
+ aLineCap);
if(aDashArray.empty())
{