Clone in a terminal:
Commit 2261011
Johan Mattsson - 2015-05-28T22:53:50+00:00
2261011568de3166e78ce5d89ace897d580f138ejohan.mattsson.m@gmail.com

Fix grid width

Changed files (4)

Diff

diff --git a/libbirdfont/BirdFont.vala b/libbirdfont/BirdFont.valaindex 0e41f2f..ca87c6a 100644--- a/libbirdfont/BirdFont.vala+++ b/libbirdfont/BirdFont.vala@@ -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)) {diff --git a/libbirdfont/Font.vala b/libbirdfont/Font.valaindex f37ed37..e4bf11d 100644--- a/libbirdfont/Font.vala+++ b/libbirdfont/Font.vala@@ -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. */diff --git a/libbirdfont/OverView.vala b/libbirdfont/OverView.valaindex db65e63..94ae2e8 100644--- a/libbirdfont/OverView.vala+++ b/libbirdfont/OverView.vala@@ -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 ();diff --git a/libbirdfont/VersionList.vala b/libbirdfont/VersionList.valaindex 3e140ee..a59a71f 100644--- a/libbirdfont/VersionList.vala+++ b/libbirdfont/VersionList.vala@@ -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 () {

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112