summaryrefslogtreecommitdiffstats
path: root/src/splivarot.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-04-14 20:48:12 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-04-14 20:48:12 +0000
commit646534345d309233570969f98fcf9495c19d45ae (patch)
treee4d510a4453de3107d9da5c2072019ed0364541d /src/splivarot.cpp
parentpatch by Gellule, fixes wrong parsing of style, work-around for bug in libc++ (diff)
downloadinkscape-646534345d309233570969f98fcf9495c19d45ae.tar.gz
inkscape-646534345d309233570969f98fcf9495c19d45ae.zip
Improve calculation precision of stroke-to-path, for very large user units that make the stroke width a very small number.
Fixed bugs: - https://launchpad.net/bugs/1244861 (bzr r13286)
Diffstat (limited to 'src/splivarot.cpp')
-rw-r--r--src/splivarot.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 6aec42c5b..40f3f174a 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -960,16 +960,17 @@ Geom::PathVector* item_outline(SPItem const *item, bool bbox_only)
Geom::Affine const transform(item->transform);
float const scale = transform.descrim();
- float o_width, o_miter;
+ float o_width = i_style->stroke_width.computed;
+ if (o_width < Geom::EPSILON) {
+ // This may result in rounding errors for very small stroke widths (happens e.g. when user unit is large).
+ // See bug lp:1244861
+ o_width = Geom::EPSILON;
+ }
+ float o_miter = i_style->stroke_miterlimit.value * o_width;
+
JoinType o_join;
ButtType o_butt;
{
- o_width = i_style->stroke_width.computed;
- if (o_width < 0.01) {
- o_width = 0.01;
- }
- o_miter = i_style->stroke_miterlimit.value * o_width;
-
switch (i_style->stroke_linejoin.computed) {
case SP_STROKE_LINEJOIN_MITER:
o_join = join_pointy;