From 6439d9dceb266f7fe9f511e363ff3d7215025292 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Wed, 13 Feb 2008 19:18:11 +0000 Subject: [PATCH] fix center of the generated marker to be at the rotation center, not geometric center --- src/selection-chemistry.cpp | 5 +++-- 1 file 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 r = selection->bounds(); - if ( !r || r->isEmpty() ) { + NR::Maybe 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)); -- 2.30.2