The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Hide rotate and resize handle

These changes was commited to the Birdfont repository Sun, 19 Apr 2015 12:28:54 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 19 Apr 2015 12:28:54 +0000 (14:28 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 19 Apr 2015 12:28:54 +0000 (14:28 +0200)
commit 603f38147b54dbdb3f82845236ac629d01b091a1
tree 9ee9c4c049864639c11d1f6d1fa49a8300c9356d
parent 01b526d4529ad1483b6c9cddb56189d88feebaea
Hide rotate and resize handle

libbirdfont/Glyph.vala
libbirdfont/MoveTool.vala
libbirdfont/ResizeTool.vala
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -173,7 +173,9 @@ path = (!) p; if (Toolbox.get_move_tool ().is_selected ()) { - Toolbox.set_object_stroke (path.stroke); + if (path.stroke > 0) { + Toolbox.set_object_stroke (path.stroke); + } } if (!active_paths.contains (path)) {
--- a/libbirdfont/MoveTool.vala +++ b/libbirdfont/MoveTool.vala @@ -234,7 +234,7 @@ cr.save (); - Theme.color (cr, "Default Background"); + Theme.color (cr, "Foreground 1"); cr.set_line_width (2); cr.rectangle (x, y, w, h); cr.stroke ();
--- a/libbirdfont/ResizeTool.vala +++ b/libbirdfont/ResizeTool.vala @@ -129,11 +129,11 @@ Text handle; Glyph g = MainWindow.get_current_glyph (); - foreach (Path p in g.active_paths) { + if (!rotate_path) { handle = new Text ("resize_handle", 60 * MainWindow.units); handle.load_font ("icons.bf"); - get_reseize_handle_position (p, out handle.widget_x, out handle.widget_y); + get_reseize_handle_position (out handle.widget_x, out handle.widget_y); handle.widget_x -= handle.get_sidebearing_extent () / 2; handle.widget_y -= handle.get_height () / 2; @@ -142,7 +142,7 @@ handle.draw (cr); } - if (g.active_paths.size > 0) { + if (!resize_path && g.active_paths.size > 0) { draw_rotate_handle (cr); } @@ -154,9 +154,9 @@ }); } - public static void get_reseize_handle_position (Path p, out double px, out double py) { - px = Glyph.reverse_path_coordinate_x (p.xmax); - py = Glyph.reverse_path_coordinate_y (p.ymax); + public static void get_reseize_handle_position (out double px, out double py) { + px = Glyph.reverse_path_coordinate_x (selection_box_center_x + selection_box_width / 2); + py = Glyph.reverse_path_coordinate_y (selection_box_center_y + selection_box_height / 2); } public static double get_rotated_handle_length () { @@ -378,7 +378,7 @@ bool is_over_resize_handle (Path p, double x, double y) { double handle_x, handle_y; - get_reseize_handle_position (p, out handle_x, out handle_y); + get_reseize_handle_position (out handle_x, out handle_y); return Path.distance (handle_x, x, handle_y, y) < 12 * MainWindow.units; }