summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-02-13 19:18:11 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-02-13 19:18:11 +0000
commitb0a493e92a1528c1f71f6273cf977578fcb6f13e (patch)
treefcb6ae6d9e792b09efa5282ae6484e94aea48000 /src/selection-chemistry.cpp
parentfix scaling with stroke width for user-created markers (diff)
downloadinkscape-b0a493e92a1528c1f71f6273cf977578fcb6f13e.tar.gz
inkscape-b0a493e92a1528c1f71f6273cf977578fcb6f13e.zip
fix center of the generated marker to be at the rotation center, not geometric center
(bzr r4725)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 07b79b259..e17452a55 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -2428,12 +2428,13 @@ void sp_selection_to_marker(bool apply)
sp_document_ensure_up_to_date(doc);
NR::Maybe<NR::Rect> r = selection->bounds();
- if ( !r || r->isEmpty() ) {
+ NR::Maybe<NR::Point> c = selection->center();
+ if ( !r || !c || r->isEmpty() ) {
return;
}
// calculate the transform to be applied to objects to move them to 0,0
- NR::Point move_p = NR::Point(0, sp_document_height(doc)) - (r->min() + NR::Point ((r->extent(NR::X))/2, (r->extent(NR::Y))/2));
+ NR::Point move_p = NR::Point(0, sp_document_height(doc)) - *c;
move_p[NR::Y] = -move_p[NR::Y];
NR::Matrix move = NR::Matrix (NR::translate (move_p));