summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8be887d)
raw | patch | inline | side by side (parent: 8be887d)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 13 Nov 2007 01:28:48 +0000 (01:28 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 13 Nov 2007 01:28:48 +0000 (01:28 +0000) |
src/ui/dialog/transformation.cpp | patch | blob | history |
index a87f473e87b66dbf2d78a4394bd197c944b537fa..3110289d2c82dd396ff1bfe7f21983c1cd321f2b 100644 (file)
NR::Maybe<NR::Rect> 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);
// 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);