index d01bb3e50561555d8f9ad1d16a821429406a7fbb..4da9b33b86e15680b3588c2cee35c1ab2826a41d 100644 (file)
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));
}
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));
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);