From dbc9ab3286ecb7a885ae9bdb524174c661607d6a Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 15:04:03 -0400 Subject: Removed "helper/units.h" from "selection-chemistry.cpp". (bzr r12380.1.37) --- src/selection-chemistry.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 29cb208d9..dc786f340 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -86,7 +86,6 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include #include #include -#include "helper/units.h" #include "sp-item.h" #include "box3d.h" #include "persp3d.h" -- cgit v1.2.3 From f1cdb3b3f47c7187d9325e8ddd8e630268dc8e8b Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 31 Jul 2013 18:33:03 -0400 Subject: Eliminate "unit-constants.h". (bzr r12380.1.54) --- src/selection-chemistry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index dc786f340..5976555f4 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -89,7 +89,7 @@ SPCycleType SP_CYCLING = SP_CYCLE_FOCUS; #include "sp-item.h" #include "box3d.h" #include "persp3d.h" -#include "unit-constants.h" +#include "util/units.h" #include "xml/simple-document.h" #include "sp-filter-reference.h" #include "gradient-drag.h" @@ -3397,7 +3397,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) res = prefs_res; } else if (0 < prefs_min) { // If minsize is given, look up minimum bitmap size (default 250 pixels) and calculate resolution from it - res = PX_PER_IN * prefs_min / MIN(bbox->width(), bbox->height()); + res = Inkscape::Util::Quantity::convert(1, "in", "px") * prefs_min / MIN(bbox->width(), bbox->height()); } else { float hint_xdpi = 0, hint_ydpi = 0; Glib::ustring hint_filename; @@ -3412,14 +3412,14 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) res = hint_xdpi; } else { // if all else fails, take the default 90 dpi - res = PX_PER_IN; + res = Inkscape::Util::Quantity::convert(1, "in", "px"); } } } // The width and height of the bitmap in pixels - unsigned width = (unsigned) floor(bbox->width() * res / PX_PER_IN); - unsigned height =(unsigned) floor(bbox->height() * res / PX_PER_IN); + unsigned width = (unsigned) floor(bbox->width() * res / Inkscape::Util::Quantity::convert(1, "in", "px")); + unsigned height =(unsigned) floor(bbox->height() * res / Inkscape::Util::Quantity::convert(1, "in", "px")); // Find out if we have to run an external filter gchar const *run = NULL; @@ -3451,7 +3451,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) double shift_x = bbox->min()[Geom::X]; double shift_y = bbox->max()[Geom::Y]; - if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid + if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 90 dpi, snap it to pixel grid 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 } @@ -3484,7 +3484,7 @@ void sp_selection_create_bitmap_copy(SPDesktop *desktop) // Create the repr for the image Inkscape::XML::Node * repr = xml_doc->createElement("svg:image"); sp_embed_image(repr, pb, "image/png"); - if (res == PX_PER_IN) { // for default 90 dpi, snap it to pixel grid + if (res == Inkscape::Util::Quantity::convert(1, "in", "px")) { // for default 90 dpi, snap it to pixel grid sp_repr_set_svg_double(repr, "width", width); sp_repr_set_svg_double(repr, "height", height); } else { -- cgit v1.2.3