summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14cb772)
raw | patch | inline | side by side (parent: 14cb772)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 13 Feb 2008 19:18:11 +0000 (19:18 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 13 Feb 2008 19:18:11 +0000 (19:18 +0000) |
src/selection-chemistry.cpp | patch | blob | history |
index 07b79b2596047c4fac865df8a49de8c8453105a4..e17452a5521a7bccd31aa31b97b550d6f34f68d9 100644 (file)
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));