The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix grid width

These changes was commited to the Birdfont repository Thu, 28 May 2015 22:53:50 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Thu, 28 May 2015 22:53:50 +0000]

Updated Files

libbirdfont/BirdFont.vala
libbirdfont/Font.vala
libbirdfont/OverView.vala
libbirdfont/VersionList.vala
--- a/libbirdfont/BirdFont.vala +++ b/libbirdfont/BirdFont.vala @@ -590,9 +590,9 @@ 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)) {
--- a/libbirdfont/Font.vala +++ b/libbirdfont/Font.vala @@ -81,7 +81,8 @@ OpenFontFormatReader otf; bool otf_font = false; - + + /** Grid sizes. */ public Gee.ArrayList<string> grid_width; /** File format. */
--- a/libbirdfont/OverView.vala +++ b/libbirdfont/OverView.vala @@ -1050,7 +1050,6 @@ gc = selected_items.get (0); foreach (OverViewItem i in visible_items) { - if (i.glyphs != null && gc == ((!) i.glyphs)) { break; } @@ -1068,6 +1067,7 @@ } 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 @@ 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 ();
--- a/libbirdfont/VersionList.vala +++ b/libbirdfont/VersionList.vala @@ -40,7 +40,9 @@ 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 @@ 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 @@ 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 () {