diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2007-04-25 22:59:03 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2007-04-25 22:59:03 +0000 |
| commit | 3b51a1d90fedb97501b8e41335eea3c02732fa2b (patch) | |
| tree | 08576d7418eb3b79b6588c8e5f352a53521604f1 /src | |
| parent | Set up toolbox so that paint bucket defaults can be reset (diff) | |
| download | inkscape-3b51a1d90fedb97501b8e41335eea3c02732fa2b.tar.gz inkscape-3b51a1d90fedb97501b8e41335eea3c02732fa2b.zip | |
In node tool: make rotation by [] and scaling by <> also use the active node as center (if there is one)
(bzr r2964)
Diffstat (limited to 'src')
| -rw-r--r-- | src/nodepath.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp index 0ad4c66a0..6c558149c 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -3662,10 +3662,16 @@ void sp_nodepath_selected_nodes_rotate(Inkscape::NodePath::Path *nodepath, gdoub rot = angle; } + NR::Point rot_center; + if (Inkscape::NodePath::Path::active_node == NULL) + rot_center = box.midpoint(); + else + rot_center = Inkscape::NodePath::Path::active_node->pos; + NR::Matrix t = - NR::Matrix (NR::translate(-box.midpoint())) * + NR::Matrix (NR::translate(-rot_center)) * NR::Matrix (NR::rotate(rot)) * - NR::Matrix (NR::translate(box.midpoint())); + NR::Matrix (NR::translate(rot_center)); for (GList *l = nodepath->selected; l != NULL; l = l->next) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) l->data; @@ -3787,10 +3793,16 @@ void sp_nodepath_selected_nodes_scale(Inkscape::NodePath::Path *nodepath, gdoubl double scale = (box.maxExtent() + grow)/box.maxExtent(); + NR::Point scale_center; + if (Inkscape::NodePath::Path::active_node == NULL) + scale_center = box.midpoint(); + else + scale_center = Inkscape::NodePath::Path::active_node->pos; + NR::Matrix t = - NR::Matrix (NR::translate(-box.midpoint())) * + NR::Matrix (NR::translate(-scale_center)) * NR::Matrix (NR::scale(scale, scale)) * - NR::Matrix (NR::translate(box.midpoint())); + NR::Matrix (NR::translate(scale_center)); for (GList *l = nodepath->selected; l != NULL; l = l->next) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) l->data; |
