Code

excise never-used code and stale comments
[inkscape.git] / src / selection-chemistry.cpp
index d01bb3e50561555d8f9ad1d16a821429406a7fbb..4da9b33b86e15680b3588c2cee35c1ab2826a41d 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));
@@ -1889,6 +1896,9 @@ sp_selection_clone()
         sp_repr_set_attr(clone, "x", "0");
         sp_repr_set_attr(clone, "y", "0");
         sp_repr_set_attr(clone, "xlink:href", g_strdup_printf("#%s", sel_repr->attribute("id")));
+
+        sp_repr_set_attr(clone, "inkscape:transform-center-x", sel_repr->attribute("inkscape:transform-center-x"));
+        sp_repr_set_attr(clone, "inkscape:transform-center-y", sel_repr->attribute("inkscape:transform-center-y"));
         
         // add the new clone to the top of the original's parent
         parent->appendChild(clone);