From a40122dd68cf8424af1c585f2028a0e52dbaab77 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Thu, 31 Jan 2013 18:40:05 -0500 Subject: Path::OutlineJoin. for inside join, simplify nodes only for obtuse angle (Bug 820425, comment 8) Fixed bugs: - https://launchpad.net/bugs/820425 (bzr r12084) --- src/livarot/PathOutline.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/livarot/PathOutline.cpp b/src/livarot/PathOutline.cpp index 1993a7862..7f8853e31 100644 --- a/src/livarot/PathOutline.cpp +++ b/src/livarot/PathOutline.cpp @@ -1189,11 +1189,15 @@ Path::OutlineJoin (Path * dest, Geom::Point pos, Geom::Point stNor, Geom::Point if ((angSi > 0 && width >= 0) || (angSi < 0 && width < 0)) { // This is an inside join -> join is independent of chosen JoinType. if ((dest->descr_cmd[dest->descr_cmd.size() - 1]->getType() == descr_lineto) && (nType == descr_lineto)) { - PathDescrLineTo* nLine = dynamic_cast(dest->descr_cmd[dest->descr_cmd.size() - 1]); Geom::Point const biss = unit_vector(Geom::rot90( stNor - enNor )); double c2 = Geom::dot (biss, enNor); - double l = width / c2; - nLine->p = pos + l*biss; // relocate to bisector + if (fabs(c2) > 0.707107) { // apply only to obtuse angles + double l = width / c2; + PathDescrLineTo* nLine = dynamic_cast(dest->descr_cmd[dest->descr_cmd.size() - 1]); + nLine->p = pos + l*biss; // relocate to bisector + } else { + dest->LineTo (pos + width*enNor); + } } else { // dest->LineTo (pos); // redundant dest->LineTo (pos + width*enNor); -- cgit v1.2.3