From: buliabyak Date: Tue, 13 Nov 2007 01:28:48 +0000 (+0000) Subject: fix 1830356 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ecdffe27412e2b5b590cf6286a88696e56165fdb;p=inkscape.git fix 1830356 --- diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index a87f473e8..3110289d2 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -617,16 +617,16 @@ Transformation::applyPageScale(Inkscape::Selection *selection) NR::Maybe bbox(sp_item_bbox_desktop(item)); if (bbox) { double new_width = scaleX; - if (new_width < 1e-6) new_width = 1e-6; // not 0, as this would result in a nasty no-bbox object + if (fabs(new_width) < 1e-6) new_width = 1e-6; // not 0, as this would result in a nasty no-bbox object double new_height = scaleY; - if (new_height < 1e-6) new_height = 1e-6; + if (fabs(new_height) < 1e-6) new_height = 1e-6; scale = NR::scale(new_width / bbox->extent(NR::X), new_height / bbox->extent(NR::Y)); } } else { double new_width = scaleX; - if (new_width < 1e-6) new_width = 1e-6; + if (fabs(new_width) < 1e-6) new_width = 1e-6; double new_height = scaleY; - if (new_height < 1e-6) new_height = 1e-6; + if (fabs(new_height) < 1e-6) new_height = 1e-6; scale = NR::scale(new_width / 100.0, new_height / 100.0); } sp_item_scale_rel (item, scale); @@ -639,15 +639,15 @@ Transformation::applyPageScale(Inkscape::Selection *selection) // the values are increments! if (_units_scale.isAbsolute()) { double new_width = scaleX; - if (new_width < 1e-6) new_width = 1e-6; + if (fabs(new_width) < 1e-6) new_width = 1e-6; double new_height = scaleY; - if (new_height < 1e-6) new_height = 1e-6; + if (fabs(new_height) < 1e-6) new_height = 1e-6; scale = NR::scale(new_width / bbox->extent(NR::X), new_height / bbox->extent(NR::Y)); } else { double new_width = scaleX; - if (new_width < 1e-6) new_width = 1e-6; + if (fabs(new_width) < 1e-6) new_width = 1e-6; double new_height = scaleY; - if (new_height < 1e-6) new_height = 1e-6; + if (fabs(new_height) < 1e-6) new_height = 1e-6; scale = NR::scale(new_width / 100.0, new_height / 100.0); } sp_selection_scale_relative(selection, center, scale);