summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/node.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-10-12 16:22:08 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-10-12 16:22:08 +0000
commitf827618fbfb446bcd954281fd46b5e88090590cf (patch)
treecaeae4259cf06ddfdbbdc81d3325dbdf4aedf456 /src/ui/tool/node.cpp
parentCherry pick node duplication from 0.48 stable (diff)
downloadinkscape-f827618fbfb446bcd954281fd46b5e88090590cf.tar.gz
inkscape-f827618fbfb446bcd954281fd46b5e88090590cf.zip
Fix oddities related to smooth endnodes. Should fix a crasher.
(bzr r9826)
Diffstat (limited to 'src/ui/tool/node.cpp')
-rw-r--r--src/ui/tool/node.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index a5952c9fb..7efb6a5dc 100644
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
@@ -580,13 +580,15 @@ void Node::setType(NodeType type, bool update_handles)
_updateAutoHandles();
break;
case NODE_SMOOTH: {
+ // ignore attempts to make smooth endnodes.
+ if (isEndNode()) return;
// rotate handles to be colinear
// for degenerate nodes set positions like auto handles
bool prev_line = _is_line_segment(_prev(), this);
bool next_line = _is_line_segment(this, _next());
if (_type == NODE_SMOOTH) {
- // for a node that is already smooth and has a degenerate handle,
- // drag out the second handle to 1/3 the length of the linear segment
+ // For a node that is already smooth and has a degenerate handle,
+ // drag out the second handle without changing the direction of the first one.
if (_front.isDegenerate()) {
double dist = Geom::distance(_next()->position(), position());
_front.setRelativePos(Geom::unit_vector(-_back.relativePos()) * dist / 3);