The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Store absolute coordinated for parts in background selection

These changes was commited to the Birdfont repository Fri, 06 Nov 2015 18:44:43 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 06 Nov 2015 18:44:43 +0000]

Updated Files

libbirdfont/BackgroundSelection.vala
libbirdfont/BirdFontFile.vala
--- a/libbirdfont/BackgroundSelection.vala +++ b/libbirdfont/BackgroundSelection.vala @@ -60,10 +60,10 @@ } } - private double height; - private double width; - private double x_img; - private double y_img; + public double height; + public double width; + public double x_img; + public double y_img; public BackgroundSelection (BackgroundImage? img, BackgroundImage parent_img, double x, double y, double w, double h) { @@ -75,8 +75,20 @@ this.y = y; this.w = w; this.h = h; + } + + public BackgroundSelection.absolute (BackgroundImage? img, BackgroundImage parent_img, + double x_img, double y_img, double width, double height) { + + assigned_glyph = null; + parent_image = parent_img; + image = img; + this.x_img = x_img; + this.y_img = y_img; + this.width = width; + this.height = height; } } }
--- a/libbirdfont/BirdFontFile.vala +++ b/libbirdfont/BirdFontFile.vala @@ -228,10 +228,10 @@ foreach (BackgroundSelection selection in b.selections) { os.put_string ("\t\t<selection "); - os.put_string (@"x=\"$(selection.x)\" "); - os.put_string (@"y=\"$(selection.y)\" "); - os.put_string (@"width=\"$(selection.w)\" "); - os.put_string (@"height=\"$(selection.h)\" "); + os.put_string (@"x=\"$(selection.x_img)\" "); + os.put_string (@"y=\"$(selection.y_img)\" "); + os.put_string (@"width=\"$(selection.width)\" "); + os.put_string (@"height=\"$(selection.height)\" "); if (selection.assigned_glyph != null) { glyph_name = (!) selection.assigned_glyph; @@ -990,7 +990,7 @@ } } - s = new BackgroundSelection (null, image, x, y, w, h); + s = new BackgroundSelection.absolute (null, image, x, y, w, h); s.assigned_glyph = assigned_glyph; image.selections.add (s);