Commit b45bdf0
adjust margin in over view
Changed files (4)
modifiedlibbirdfont/Glyph.valamodifiedlibbirdfont/OpenFontFormat/HeadTable.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/Path.vala
Diff
@@ -1070,9 +1070,7 @@ public class Glyph : FontDisplay { return open; } - /** Close all editable paths and return false if no path have boon closed. - * Paths without area (points and lines) will be deleted.- */+ /** Close all editable paths and return false if no path have been closed. */ public bool close_path () { bool r = false; @@ -40,7 +40,7 @@ class HeadTable : Table { uint64 created; uint64 modified; - uint16 units_per_em = 2048;+ uint16 units_per_em = 4096; const uint8 BASELINE_AT_ZERO = 1 << 0; const uint8 LSB_AT_ZERO = 1 << 1;@@ -214,6 +214,16 @@ public class OverView : FontDisplay { return visible_items.nth (selected).data; } + int get_items_per_row () {+ int i = 1;+ double l = OverViewItem.full_width ();+ while (l < allocation.width) {+ l += OverViewItem.full_width ();+ i++;+ }+ return i - 1;+ }+ void update_item_list () { string character_string; Font f = BirdFont.get_current_font ();@@ -224,8 +234,9 @@ public class OverView : FontDisplay { unichar character; Glyph glyph; - items_per_row = (int) (allocation.width / OverViewItem.full_width ());- rows = (int) (allocation.height / OverViewItem.full_height ());+ OverViewItem.margin = OverViewItem.width * 0.1;+ items_per_row = get_items_per_row ();+ rows = (int) (allocation.height / OverViewItem.full_height ()) + 2; while (visible_items.length () > 0) { visible_items.remove_link (visible_items.first ());@@ -285,6 +296,7 @@ public class OverView : FontDisplay { foreach (OverViewItem i in visible_items) { i.y += view_offset_y;+ i.x += view_offset_x; } } @@ -1024,7 +1024,7 @@ public class Path { if (points.length () < 2) { return quadratic_path; }-+ i = points.first (); next = i.next; @@ -1047,6 +1047,8 @@ public class Path { quadratic_path.add_point (points.last ().data.copy ()); } + quadratic_path.add_hidden_double_points ();+ quadratic_path.close (); quadratic_path.create_list (); process_quadratic_handles ();@@ -1055,7 +1057,7 @@ public class Path { quadratic_path.create_list (); process_cubic_handles (); - quadratic_path.add_hidden_double_points ();+ quadratic_path.close (); return quadratic_path; }@@ -1069,7 +1071,7 @@ public class Path { return; } - steps = (int) get_length_from (start, stop);+ steps = (int) (0.6 * get_length_from (start, stop)); // create quadratic paths all_of (start, stop, (x, y, step) => {