Code

fix clearing in Scale and unit conversion in Skew
authorbuliabyak <buliabyak@users.sourceforge.net>
Tue, 22 Jan 2008 19:10:21 +0000 (19:10 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Tue, 22 Jan 2008 19:10:21 +0000 (19:10 +0000)
src/ui/dialog/transformation.cpp

index 387510b361473ae64f689d3f17e52d6db555d514..e6de922405cad9e19e9b0ae863c9139615f438fa 100644 (file)
@@ -505,7 +505,16 @@ void
 Transformation::updatePageSkew(Inkscape::Selection *selection)
 {
     if (selection && !selection->isEmpty()) {
-        _page_skew.set_sensitive(true);
+        NR::Maybe<NR::Rect> bbox = selection->bounds();
+        if (bbox) {
+            double w = bbox->extent(NR::X);
+            double h = bbox->extent(NR::Y);
+            _scalar_skew_vertical.setHundredPercent(w);
+            _scalar_skew_horizontal.setHundredPercent(h);
+            _page_skew.set_sensitive(true);
+        } else {
+            _page_skew.set_sensitive(false);
+        }
     } else {
         _page_skew.set_sensitive(false);
     }
@@ -943,8 +952,8 @@ Transformation::onClear()
         break;
     }
     case PAGE_SCALE: {
-        _scalar_scale_horizontal.setValue(100);
-        _scalar_scale_vertical.setValue(100);
+        _scalar_scale_horizontal.setValue(100, "%");
+        _scalar_scale_vertical.setValue(100, "%");
         break;
     }
     case PAGE_SKEW: {