summaryrefslogtreecommitdiffstats
path: root/src/helper/geom-pathstroke.cpp
diff options
context:
space:
mode:
authorRichard White <rwhite8282@gmail.com>2016-05-19 01:17:29 +0000
committerRichard White <rwhite8282@gmail.com>2016-05-19 01:17:29 +0000
commit1fe9c2603c33fddcd9f2688b30e843f91e1a86fa (patch)
tree13289cbe033a46a40eb829437e115b5393e2ca84 /src/helper/geom-pathstroke.cpp
parentCorrected frame extension stroke and fill values on 64 bit machine. (diff)
parentGTK3: Another widget named. (diff)
downloadinkscape-1fe9c2603c33fddcd9f2688b30e843f91e1a86fa.tar.gz
inkscape-1fe9c2603c33fddcd9f2688b30e843f91e1a86fa.zip
Merge from Inkscape trunk.
(bzr r14668.1.3)
Diffstat (limited to 'src/helper/geom-pathstroke.cpp')
-rw-r--r--src/helper/geom-pathstroke.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/helper/geom-pathstroke.cpp b/src/helper/geom-pathstroke.cpp
index 52871ae2a..d2e9f9a1b 100644
--- a/src/helper/geom-pathstroke.cpp
+++ b/src/helper/geom-pathstroke.cpp
@@ -163,7 +163,9 @@ void miter_join_internal(join_data jd, bool clip)
if (p.isFinite()) {
// check size of miter
Point point_on_path = incoming.finalPoint() + rot90(tang1)*width;
- satisfied = distance(p, point_on_path) <= miter * 2.0 * width;
+ // SVG defines miter length as distance between inner intersection and outer intersection,
+ // which is twice the distance from p to point_on_path but width is half stroke width.
+ satisfied = distance(p, point_on_path) <= miter * width;
if (satisfied) {
// miter OK, check to see if we can do a relocation
if (inc_ls) {
@@ -175,7 +177,7 @@ void miter_join_internal(join_data jd, bool clip)
// std::cout << " Clipping ------------ " << std::endl;
// miter needs clipping, find two points
Point bisector_versor = Line(point_on_path, p).versor();
- Point point_limit = point_on_path + miter * 2.0 * width * bisector_versor;
+ Point point_limit = point_on_path + miter * width * bisector_versor;
// std::cout << " bisector_versor: " << bisector_versor << std::endl;
// std::cout << " point_limit: " << point_limit << std::endl;
Point p1 = intersection_point(incoming.finalPoint(), tang1, point_limit, bisector_versor.cw());
@@ -555,7 +557,7 @@ void extrapolate_join_internal(join_data jd, int alternative)
Geom::Line bisector_chord = make_bisector_line(chord);
Geom::Line limit_line;
- double miter_limit = 2.0 * width * miter;
+ double miter_limit = width * miter;
bool clipped = false;
if (are_parallel(bisector_chord, ortho)) {