diff options
| author | Alvin Penner <penner@vaxxine.com> | 2013-01-31 23:40:05 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2013-01-31 23:40:05 +0000 |
| commit | a40122dd68cf8424af1c585f2028a0e52dbaab77 (patch) | |
| tree | ef85db97a0238b9f8b99ef8ba8e37693112d9f33 /src | |
| parent | Clean up Cairo rendering in a couple of widgets (diff) | |
| download | inkscape-a40122dd68cf8424af1c585f2028a0e52dbaab77.tar.gz inkscape-a40122dd68cf8424af1c585f2028a0e52dbaab77.zip | |
Path::OutlineJoin. for inside join, simplify nodes only for obtuse angle (Bug 820425, comment 8)
Fixed bugs:
- https://launchpad.net/bugs/820425
(bzr r12084)
Diffstat (limited to 'src')
| -rw-r--r-- | src/livarot/PathOutline.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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<PathDescrLineTo*>(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<PathDescrLineTo*>(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); |
