From 646534345d309233570969f98fcf9495c19d45ae Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 14 Apr 2014 22:48:12 +0200 Subject: 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) --- src/splivarot.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/splivarot.cpp') 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; -- cgit v1.2.3