summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cedaf1f)
raw | patch | inline | side by side (parent: cedaf1f)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 15 Apr 2006 03:09:43 +0000 (03:09 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 15 Apr 2006 03:09:43 +0000 (03:09 +0000) |
src/nodepath.cpp | patch | blob | history |
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 8aed0420bb461f94f5ccf051ea5f6d456535474b..35f64c1b38326c17d41d74e75d34ca2a63caa0f5 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -836,9 +836,9 @@ static Inkscape::NodePath::Node *sp_nodepath_set_node_type(Inkscape::NodePath::N
}
// if one of handles is mouseovered, preserve its position
- if (node->p.knot && SP_KNOT_IS_MOSEOVER(node->p.knot)) {
+ if (node->p.knot && SP_KNOT_IS_MOUSEOVER(node->p.knot)) {
sp_node_adjust_handle(node, 1);
- } else if (node->n.knot && SP_KNOT_IS_MOSEOVER(node->n.knot)) {
+ } else if (node->n.knot && SP_KNOT_IS_MOUSEOVER(node->n.knot)) {
sp_node_adjust_handle(node, -1);
} else {
sp_node_adjust_handles(node);
/* a and b are endpoints */
- NR::Point c = (a->pos + b->pos) / 2;
+ NR::Point c;
+ if (a->knot && SP_KNOT_IS_MOUSEOVER(a->knot)) {
+ c = a->pos;
+ } else if (b->knot && SP_KNOT_IS_MOUSEOVER(b->knot)) {
+ c = b->pos;
+ } else {
+ c = (a->pos + b->pos) / 2;
+ }
if (a->subpath == b->subpath) {
Inkscape::NodePath::SubPath *sp = a->subpath;
sp_nodepath_subpath_close(sp);
+ sp_node_moveto (sp->first, c);
sp_nodepath_update_handles(sp->nodepath);
-
sp_nodepath_update_repr(nodepath);
-
return;
}
//Link the head to the tail
sp->first->p.other = sp->last;
sp->last->n.other = sp->first;
- sp->last->n.pos = sp->first->n.pos;
+ sp->last->n.pos = sp->last->pos + (sp->first->n.pos - sp->first->pos);
sp->first = sp->last;
//Remove the extra end node