Commit e24d059
set color for selected path
Changed files (3)
Diff
@@ -1301,9 +1301,13 @@ class Glyph : FontDisplay { foreach (unowned Path p in path_list) { p.draw_outline (cr, allocation, view_zoom); p.draw_edit_points (cr, allocation, view_zoom);- + }+ }++ if (!is_open ()) {+ foreach (unowned Path p in active_paths) { if (!p.is_editable ()) {- // p.fill_path (cr, allocation, view_zoom);+ p.fill_path (cr, allocation, view_zoom); } } }@@ -32,13 +32,7 @@ class MoveTool : Tool { deselect_action.connect((self) => { Glyph glyph = MainWindow.get_current_glyph ();- glyph.clear_active_paths ();-- foreach (Path p in glyph.path_list) {- p.set_color (0, 0, 0, 1);- p.set_selected (false);- } }); press_action.connect((self, b, x, y) => {@@ -53,22 +47,7 @@ class MoveTool : Tool { } move_path = true;- - foreach (Path p in glyph.path_list) {- p.set_color (0, 0, 0, 1);- p.set_selected (false);- }- - foreach (Path path in glyph.active_paths) {- if (path.is_clockwise ()) {- path.set_color (0.2, 0.2, 0.4, 0.8);- path.set_selected (true);- } else {- path.set_color (0.5, 0.5, 0.7, 0.8);- path.set_selected (true);- }- }- + last_x = x; last_y = y; });@@ -47,11 +47,6 @@ class Path { bool clockwise_direction = true; public delegate bool RasterIterator (double x, double y, double step); // iterate over each pixel at a given zoom level-- public double r = 0;- public double g = 0;- public double b = 0;- public double a = 1; bool selected = false; @@ -77,13 +72,6 @@ class Path { } } - public void set_color (double r, double g, double b, double a) {- this.r = r;- this.g = g;- this.b = b;- this.a = a;- }- public bool empty () { return points.length () == 0; }@@ -176,7 +164,13 @@ class Path { // fill path cr.close_path ();- cr.set_source_rgba (r, g, b, a);+ + if (is_clockwise ()) {+ cr.set_source_rgba (80/255.0, 95/255.0, 137/255.0, 0.5);+ } else {+ cr.set_source_rgba (144/255.0, 145/255.0, 236/255.0, 0.5);+ }+ cr.fill (); }