Commit c5ececa
fix compiler warnings
Changed files (8)
modifiedlibbirdfont/BirdFontFile.valamodifiedlibbirdfont/ExportTool.valamodifiedlibbirdfont/Glyph.valamodifiedlibbirdfont/GridTool.valamodifiedlibbirdfont/KerningDisplay.valamodifiedlibbirdfont/OpenFontFormat/GlyfTable.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/ResizeTool.vala
Diff
@@ -91,7 +91,6 @@ class BirdFontFile { File file = File.new_for_path (path); uint num_kerning_pairs; uint progress;- uint num_glyphs; if (file.query_file_type (0) == FileType.DIRECTORY) { warning (@"Can not save font. $path is a directory.");@@ -168,7 +168,6 @@ public class ExportTool : GLib.Object { static void do_export () { bool f;- Preview preview; f = export_ttf_font (); if (!f) {@@ -975,7 +975,6 @@ public class Glyph : FontDisplay { public void move_selected_edit_point_coordinates (EditPoint selected_point, double xt, double yt) { double x, y;- EditPoint p; BirdFont.get_current_font ().touch (); @@ -139,11 +139,6 @@ class GridTool : Tool { } }- - /** Sets x and y the point closest on grid. */- public static void tie (ref double x, ref double y) {- tie_point (ref x, ref y, false);- } public static void tie_coordinate (ref double x, ref double y) { tie_point (ref x, ref y, true);@@ -61,10 +61,6 @@ public class KerningDisplay : FontDisplay { } } - private void draw_list (WidgetAllocation allocation, Context cr) {- kerning_list.draw (allocation, cr);- }- public void draw_error_message (WidgetAllocation allocation, Context cr) { string line1 = _("The current kerning class is malformed."); string line2 = _("Add single characters separated by space and ranges on the form A-Z.");@@ -60,19 +60,6 @@ class GlyfTable : Table { glyphs = new List<Glyph> (); } - public int get_gid_from_unicode (unichar c) {- int i = 0;- foreach (Glyph g in glyphs) {- if (g.unichar_code == c) {- return i;- }- - i++;- }- - return -1;- }- public int get_gid (string name) { int i = 0; @@ -260,7 +247,9 @@ class GlyfTable : Table { // flags nflags = glyf_data.get_nflags ();- if (nflags != npoints) {+ if (unlikely (nflags != npoints)) {+ print ("glyf table data:\n");+ fd.dump (); warning (@"(nflags != npoints) ($nflags != $npoints) in glyph $(g.name). ncontours: $ncontours"); } assert (nflags == npoints);@@ -852,6 +852,10 @@ public class OverView : FontDisplay { x = (allocation.width - w) / 2.0; } + if (x < 0) {+ x = 0;+ }+ // background cr.save (); cr.set_source_rgba (1, 1, 1, 0.98);@@ -79,8 +79,6 @@ class ResizeTool : Tool { }); move_action.connect ((self, x, y) => {- Glyph glyph = MainWindow.get_current_glyph ();- if (resize_path && can_resize (x, y)) { resize (x, y); }@@ -107,37 +105,6 @@ class ResizeTool : Tool { out selection_box_center_y, out selection_box_width, out selection_box_height); }- - void move_selected_paths (uint key) {- Glyph glyph = MainWindow.get_current_glyph ();- double x, y;- - x = 0;- y = 0;- - switch (key) {- case Key.UP:- y = 1;- break;- case Key.DOWN:- y = -1;- break;- case Key.LEFT:- x = -1;- break;- case Key.RIGHT:- x = 1;- break;- default:- break;- }- - foreach (Path path in glyph.active_paths) {- path.move (x * Glyph.ivz (), y * Glyph.ivz ());- }- - glyph.redraw_area (0, 0, glyph.allocation.width, glyph.allocation.height);- } double get_resize_ratio (double x, double y) { double ratio;