Commit 41a37da
Move flip path button and other tools to modifiers.
Changed files (5)
modifiedlibbirdfont/DrawingTools.valamodifiedlibbirdfont/Expander.valamodifiedlibbirdfont/FontName.valamodifiedlibbirdfont/Renderer/Text.valamodifiedlibbirdfont/VersionList.vala
Diff
@@ -1325,10 +1325,10 @@ public class DrawingTools : ToolCollection { height.set_tool_visibility (true); skew.set_tool_visibility (true); - reverse_path_tool.set_selected (true);- move_layer.set_selected (true);- flip_vertical.set_selected (true);- flip_horizontal.set_selected (true);+ reverse_path_tool.set_tool_visibility (true);+ move_layer.set_tool_visibility (true);+ flip_vertical.set_tool_visibility (true);+ flip_horizontal.set_tool_visibility (true); } void update_drawing_and_background_tools (Tool current_tool) {@@ -99,7 +99,7 @@ public class Expander : GLib.Object { foreach (Tool t in tool) { if (t is OverviewTool) {- t.w = Toolbox.allocation_width;+ t.w = Toolbox.allocation_width * scale; t.h = 15 * scale; } else if (t is FontName) { t.w = Toolbox.allocation_width * scale;@@ -29,12 +29,22 @@ public class FontName : Tool { public override void draw (Context cr) { Text font_name; double text_height;+ double extent;+ double width = Toolbox.allocation_width * Toolbox.get_scale ();+ double max_width; cr.save (); // tab label font_name = new Text (); font_name.set_text (BirdFont.get_current_font ().get_full_name ()); text_height = 12;+ + max_width = (width - 2 * x * Toolbox.get_scale ());+ extent = font_name.get_extent (text_height) * Toolbox.get_scale ();+ if (extent > max_width) {+ text_height *= max_width / extent;+ }+ cr.set_source_rgba (234 / 255.0, 77 / 255.0, 26 / 255.0, 1); font_name.draw (cr, x, y + 3, text_height); cr.restore ();@@ -98,7 +98,7 @@ public class Text { for (int i = 0; i < word_with_ligatures.glyph.size; i++) { g = word_with_ligatures.glyph.get (i); - if (prev == null || wi == 0) {+ if (g == null || prev == null || wi == 0) { kern = 0; } else { return_if_fail (wi < word_with_ligatures.ranges.size);@@ -204,7 +204,8 @@ public class VersionList : DropMenu { updated_glyph.view_zoom = glyph.view_zoom; updated_glyph.view_offset_x = glyph.view_offset_x; updated_glyph.view_offset_y = glyph.view_offset_y;- updated_glyph.close_path ();+ // FIXME: don't run this in Renderer+ // updated_glyph.close_path (); } }