Code

obey scale ratio lock
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 27 Mar 2006 17:13:26 +0000 (17:13 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 27 Mar 2006 17:13:26 +0000 (17:13 +0000)
src/selection-chemistry.cpp

index d01bb3e50561555d8f9ad1d16a821429406a7fbb..811e0d6bdaaff0bfcb475d9baefda15deeafd544 100644 (file)
@@ -1151,7 +1151,10 @@ void sp_selection_paste_size (bool apply_x, bool apply_y)
     double scale_x = size_clipboard.extent(NR::X) / current.extent(NR::X);
     double scale_y = size_clipboard.extent(NR::Y) / current.extent(NR::Y);
 
-    sp_selection_scale_relative (selection, current.midpoint(), NR::scale(apply_x? scale_x : 1.0, apply_y? scale_y : 1.0));
+    sp_selection_scale_relative (selection, current.midpoint(), 
+                                 NR::scale(
+                                     apply_x? scale_x : (desktop->isToolboxButtonActive ("lock")? scale_y : 1.0),
+                                     apply_y? scale_y : (desktop->isToolboxButtonActive ("lock")? scale_x : 1.0)));
 
     sp_document_done(SP_DT_DOCUMENT (desktop));
 }
@@ -1186,7 +1189,11 @@ void sp_selection_paste_size_separately (bool apply_x, bool apply_y)
         double scale_x = size_clipboard.extent(NR::X) / current.extent(NR::X);
         double scale_y = size_clipboard.extent(NR::Y) / current.extent(NR::Y);
 
-        sp_item_scale_rel (item, NR::scale(apply_x? scale_x : 1.0, apply_y? scale_y : 1.0));
+        sp_item_scale_rel (item,
+                                 NR::scale(
+                                     apply_x? scale_x : (desktop->isToolboxButtonActive ("lock")? scale_y : 1.0),
+                                     apply_y? scale_y : (desktop->isToolboxButtonActive ("lock")? scale_x : 1.0)));
+
     }
 
     sp_document_done(SP_DT_DOCUMENT (desktop));