Commit 2261011
Fix grid width
Changed files (4)
modifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/Font.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/VersionList.vala
Diff
@@ -590,9 +590,9 @@ public class BirdFont { if (!is_null (MainWindow.tools)) { MainWindow.get_drawing_tools ().remove_all_grid_buttons ();- DrawingTools.add_new_grid (1);- DrawingTools.add_new_grid (2);- DrawingTools.add_new_grid (4);+ DrawingTools.add_new_grid (1, false);+ DrawingTools.add_new_grid (2, false);+ DrawingTools.add_new_grid (4, false); } if (!is_null (Toolbox.background_tools)) {@@ -81,7 +81,8 @@ public class Font : GLib.Object { OpenFontFormatReader otf; bool otf_font = false;- ++ /** Grid sizes. */ public Gee.ArrayList<string> grid_width; /** File format. */@@ -1050,7 +1050,6 @@ public class OverView : FontDisplay { gc = selected_items.get (0); foreach (OverViewItem i in visible_items) {- if (i.glyphs != null && gc == ((!) i.glyphs)) { break; }@@ -1068,6 +1067,7 @@ public class OverView : FontDisplay { } public override void button_press (uint button, double x, double y) {+ OverViewItem i; int index = 0; int selected_index = -1; bool update = false;@@ -1078,7 +1078,9 @@ public class OverView : FontDisplay { return; } - foreach (OverViewItem i in visible_items) {+ for (int j = 0; j < visible_items.size; j++) {+ i = visible_items.get (j);+ if (i.click (button, x, y)) { selected = index; selected_item = get_selected_item ();@@ -40,7 +40,9 @@ public class VersionList : GLib.Object { Gee.ArrayList <MenuAction> actions = new Gee.ArrayList <MenuAction> (); const int item_height = 25; MenuDirection direction = MenuDirection.DROP_DOWN;- ++ // Glyphs gets added to and removed from the glyph collection in + // these signal. public signal void signal_delete_item (int item_index); public signal void add_glyph_item (Glyph item); @@ -95,12 +97,13 @@ public class VersionList : GLib.Object { font.deleted_glyphs.add (glyph_collection.get_current ()); over_view.store_undo_state (glyph_collection.copy ()); + current_version = get_current_version_index ();+ glyphs.remove_at (index); glyph_collection.remove (index); recreate_index (); - current_version = get_current_version_index (); if (index == current_version) { set_selected_item (get_action_no2 ()); // select the first glyph if the current glyph is deleted } else if (index < current_version) {@@ -157,8 +160,12 @@ public class VersionList : GLib.Object { Glyph g = get_current (); Glyph new_version = g.copy (); new_version.version_id = get_last_id () + 1;- add_glyph (new_version);+ + // send signal back to the collection add_glyph_item (new_version);+ + // add the item to the menu+ add_glyph (new_version); } public int get_last_id () {