summaryrefslogtreecommitdiff
path: root/drawinglayer/source/attribute
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2016-04-09 23:15:09 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2016-04-26 16:42:27 +0000
commit32cec4ca8bf1e09dd33aa461984e8e8ae34f4a7c (patch)
tree5591a63de12179505a0e7a4870632754585152d3 /drawinglayer/source/attribute
parent4905c8bf7834b1ca79139c62f4e8b0672e9ddc13 (diff)
tdf#48066 render stroke-miterlimit correctly in SVG import
The property stroke-miterlimit is transported to the renderers via a new member mfMiterMinimumAngle in class LineAttribute Several drawPolyLine methods are adapted. This patch does not include changes in MetaAction. Presentation mode, printing, and PDF-export is still wrong. Corrected LineJoinMiter to LineJoinBevel in canvas, that s closer to NONE. Removed DrawPolyLine method without MiterMinimumAngle and adapted calls accordingly. Change-Id: I6bcd24add5d85c4d9a39e3788e0682091c5fc9c4 Reviewed-on: https://gerrit.libreoffice.org/23946 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'drawinglayer/source/attribute')
-rw-r--r--drawinglayer/source/attribute/lineattribute.cxx25
1 files changed, 19 insertions, 6 deletions
diff --git a/drawinglayer/source/attribute/lineattribute.cxx b/drawinglayer/source/attribute/lineattribute.cxx
index 5e720fbd6969..89ce998924fe 100644
--- a/drawinglayer/source/attribute/lineattribute.cxx
+++ b/drawinglayer/source/attribute/lineattribute.cxx
@@ -34,16 +34,19 @@ namespace drawinglayer
double mfWidth; // absolute line width
basegfx::B2DLineJoin meLineJoin; // type of LineJoin
css::drawing::LineCap meLineCap; // BUTT, ROUND, or SQUARE
+ double mfMiterMinimumAngle; // as needed for createAreaGeometry
ImpLineAttribute(
const basegfx::BColor& rColor,
double fWidth,
basegfx::B2DLineJoin aB2DLineJoin,
- css::drawing::LineCap aLineCap)
+ css::drawing::LineCap aLineCap,
+ double fMiterMinimumAngle)
: maColor(rColor),
mfWidth(fWidth),
meLineJoin(aB2DLineJoin),
- meLineCap(aLineCap)
+ meLineCap(aLineCap),
+ mfMiterMinimumAngle(fMiterMinimumAngle)
{
}
@@ -51,7 +54,8 @@ namespace drawinglayer
: maColor(basegfx::BColor()),
mfWidth(0.0),
meLineJoin(basegfx::B2DLineJoin::Round),
- meLineCap(css::drawing::LineCap_BUTT)
+ meLineCap(css::drawing::LineCap_BUTT),
+ mfMiterMinimumAngle(15.0 * F_PI180)
{
}
@@ -60,13 +64,15 @@ namespace drawinglayer
double getWidth() const { return mfWidth; }
basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; }
css::drawing::LineCap getLineCap() const { return meLineCap; }
+ double getMiterMinimumAngle() const { return mfMiterMinimumAngle; }
bool operator==(const ImpLineAttribute& rCandidate) const
{
return (getColor() == rCandidate.getColor()
&& getWidth() == rCandidate.getWidth()
&& getLineJoin() == rCandidate.getLineJoin()
- && getLineCap() == rCandidate.getLineCap());
+ && getLineCap() == rCandidate.getLineCap()
+ && getMiterMinimumAngle() == rCandidate.getMiterMinimumAngle());
}
};
@@ -80,13 +86,15 @@ namespace drawinglayer
const basegfx::BColor& rColor,
double fWidth,
basegfx::B2DLineJoin aB2DLineJoin,
- css::drawing::LineCap aLineCap)
+ css::drawing::LineCap aLineCap,
+ double fMiterMinimumAngle)
: mpLineAttribute(
ImpLineAttribute(
rColor,
fWidth,
aB2DLineJoin,
- aLineCap))
+ aLineCap,
+ fMiterMinimumAngle))
{
}
@@ -144,6 +152,11 @@ namespace drawinglayer
return mpLineAttribute->getLineCap();
}
+ double LineAttribute::getMiterMinimumAngle() const
+ {
+ return mpLineAttribute->getMiterMinimumAngle();
+ }
+
} // end of namespace attribute
} // end of namespace drawinglayer