Commit 3fd033e
Update resize center when objects are moved
Changed files (2)
Diff
@@ -88,18 +88,19 @@ public class EmbeddedSvg : SvgBird.Object { svg.append ("""<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">"""); svg.append ("\n"); - svg.append ("<g");- string transforms = transforms.get_xml (); if (transforms != "") {+ svg.append ("<g"); svg.append (@" transform=\"$(transforms)\"");+ svg.append (">\n"); } - svg.append (">\n");- svg.append (remove_xml_header (svg_data));- svg.append ("</g>\n");+ + if (transforms != "") {+ svg.append ("</g>\n");+ } svg.append ("</svg>\n"); @@ -64,23 +64,8 @@ public class ResizeTool : Tool { horizontal_handle.load_font ("icons.bf"); Theme.text_color (horizontal_handle, "Highlighted 1"); - DrawingTools.move_tool.selection_changed.connect (() => {- Glyph glyph = MainWindow.get_current_glyph ();- SvgBird.Object path;- - if (glyph.active_paths.size > 0) {- path = glyph.active_paths.get (glyph.active_paths.size - 1);- - if (path is PathObject) {- last_rotate = ((PathObject) path).get_path ().rotation;- } else {- last_rotate = path.transforms.total_rotation;- }- }- - rotation = last_rotate;- update_resized_boundaries ();- });+ DrawingTools.move_tool.selection_changed.connect (update_position);+ DrawingTools.move_tool.objects_moved.connect (update_position); select_action.connect((self) => { });@@ -229,6 +214,25 @@ public class ResizeTool : Tool { }); } + public void update_position () {+ Glyph glyph = MainWindow.get_current_glyph ();+ SvgBird.Object path;+ + if (glyph.active_paths.size > 0) {+ path = glyph.active_paths.get (glyph.active_paths.size - 1);+ + if (path is PathObject) {+ last_rotate = ((PathObject) path).get_path ().rotation;+ } else {+ last_rotate = path.transforms.total_rotation;+ }+ }+ + rotation = last_rotate;+ update_selection_box ();+ update_resized_boundaries ();+ }+ public static void get_resize_handle_position (out double px, out double py) { px = Glyph.reverse_path_coordinate_x (resized_left + resized_width); py = Glyph.reverse_path_coordinate_y (-resized_top);