summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 797ae5a)
raw | patch | inline | side by side (parent: 797ae5a)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 2 Mar 2007 17:10:33 +0000 (17:10 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 2 Mar 2007 17:10:33 +0000 (17:10 +0000) |
src/selection-chemistry.cpp | patch | blob | history |
index 33f14e0506cf291d240f0f989fd1a314608b6206..680a2e87105ec343e908949c70c68ac27ec8ba22 100644 (file)
// Calculate the matrix that will be applied to the image so that it exactly overlaps the source objects
NR::Matrix eek = sp_item_i2d_affine (SP_ITEM(parent_object));
NR::Matrix t;
+
+ double shift_x = bbox.x0;
+ double shift_y = bbox.y1;
if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid
- t = NR::scale (1, -1) * NR::translate ((unsigned) (bbox.x0 + 0.5), (unsigned) (bbox.y1 + 0.5)) * eek.inverse();
- } else {
- t = NR::scale (1, -1) * NR::translate (bbox.x0, bbox.y1) * eek.inverse();
+ shift_x = round (shift_x);
+ shift_y = -round (-shift_y); // this gets correct rounding despite coordinate inversion, remove the negations when the inversion is gone
}
+ t = NR::scale(1, -1) * NR::translate (shift_x, shift_y) * eek.inverse();
// Do the export
sp_export_png_file(document, filepath,