The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Draw transparent objects when point tools are used

These changes was commited to the Birdfont repository Sun, 17 Jan 2016 22:39:01 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sun, 17 Jan 2016 22:39:01 +0000]

Updated Files

libbirdfont/Glyph.vala
libbirdfont/PathObject.vala
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -1613,37 +1613,43 @@ || (selected_tool is BezierTool); bool has_path = false; - foreach (SvgBird.Object object in get_visible_objects ()) { - if (object is PathObject - && object.stroke > 0) { - - has_path = true; - PathObject object_path = (PathObject) object; - object_path.draw_outline (cr); + + if (!draw_control_points) { + foreach (SvgBird.Object object in get_visible_objects ()) { + if (object is PathObject + && object.stroke > 0) { + + has_path = true; + PathObject object_path = (PathObject) object; + object_path.draw_path (cr); + } } - } - if (has_path) { - cr.set_fill_rule (FillRule.WINDING); - cr.set_source_rgba (0, 0, 0, 1); - cr.fill (); + if (has_path) { + cr.set_fill_rule (FillRule.WINDING); + cr.set_source_rgba (0, 0, 0, 1); + cr.fill (); + } } - + has_path = false; - foreach (SvgBird.Object object in get_visible_objects ()) { - if (object is PathObject - && object.stroke == 0) { - - has_path = true; - PathObject object_path = (PathObject) object; - object_path.draw_outline (cr); + + if (!draw_control_points) { + foreach (SvgBird.Object object in get_visible_objects ()) { + if (object is PathObject + && object.stroke == 0) { + + has_path = true; + PathObject object_path = (PathObject) object; + object_path.draw_path (cr); + } } - } - if (has_path) { - cr.set_fill_rule (FillRule.EVEN_ODD); - Theme.color (cr, "Objects"); - cr.fill (); + if (has_path) { + cr.set_fill_rule (FillRule.EVEN_ODD); + Theme.color (cr, "Objects"); + cr.fill (); + } } if (draw_control_points) { @@ -1652,7 +1658,7 @@ PathObject object_path = (PathObject) object; Glyph g = MainWindow.get_current_glyph (); cr.set_line_width (CanvasSettings.stroke_width / g.view_zoom); - object_path.path.draw_outline (cr); + object_path.path.draw_path (cr); object_path.path.draw_control_points (cr); } } @@ -1709,7 +1715,6 @@ } draw_background_glyph (allocation, cmp); - juxtapose (allocation, cmp); if (BirdFont.show_coordinates) {
--- a/libbirdfont/PathObject.vala +++ b/libbirdfont/PathObject.vala @@ -102,9 +102,11 @@ } public override void draw_outline (Context cr) { - PathList pl = new PathList (); - pl.add (path); - draw_path_list (pl, cr); + // drawing is handled in Glyph.draw_bird_font_paths + } + + public void draw_path (Context cr) { + path.draw_path (cr); } public static void draw_path_list (PathList pl, Context cr) {