Clone in a terminal:
Commit 23336d8
Johan Mattsson - 2015-11-06T18:44:43+00:00
23336d8f2d49bfaeb8ddb1440ec2753536c57b6ejohan.mattsson.m@gmail.com

Store absolute coordinated for parts in background selection Fixed a bug in the BF font format.

Changed files (2)

Diff

diff --git a/libbirdfont/BackgroundSelection.vala b/libbirdfont/BackgroundSelection.valaindex 7786d6c..e77a7b0 100644--- a/libbirdfont/BackgroundSelection.vala+++ b/libbirdfont/BackgroundSelection.vala@@ -60,10 +60,10 @@ public class BackgroundSelection : GLib.Object { 		} 	} 	-	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) {@@ -76,6 +76,18 @@ public class BackgroundSelection : GLib.Object { 		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;+	} }  }diff --git a/libbirdfont/BirdFontFile.vala b/libbirdfont/BirdFontFile.valaindex 14a3663..78e4aa1 100644--- a/libbirdfont/BirdFontFile.vala+++ b/libbirdfont/BirdFontFile.vala@@ -228,10 +228,10 @@ class BirdFontFile : GLib.Object { 				 				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 @@ class BirdFontFile : GLib.Object { 					} 				} 				-				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);

Contact

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