Clone in a terminal:
Commit 8b9d026
Johan Mattsson - 2022-09-24T21:56:28+00:00
8b9d026bcfbc365c6397f9d90116dca637ad2e75johan.mattsson.m@gmail.com

Remove old window scaling

Changed files (23)

Diff

diff --git a/libbirdfont/AbstractMenu.vala b/libbirdfont/AbstractMenu.valaindex a76c483..3168a36 100644--- a/libbirdfont/AbstractMenu.vala+++ b/libbirdfont/AbstractMenu.vala@@ -50,8 +50,8 @@ public class AbstractMenu : GLib.Object { 	SubMenu current_menu; 	WidgetAllocation allocation = new WidgetAllocation (); -	double width = 250 * MainWindow.units;-	double height = 25 * MainWindow.units;+	double width = 250;+	double height = 25; 	 	public Gee.HashMap<string, MenuItem> menu_items = new Gee.HashMap<string, MenuItem> (); 	public Gee.ArrayList<MenuItem> sorted_menu_items = new Gee.ArrayList<MenuItem> ();@@ -269,7 +269,7 @@ public class AbstractMenu : GLib.Object { 	 	public double layout_width () { 		Text key_binding = new Text ();-		double font_size = 17 * MainWindow.units;;+		double font_size = 17;; 		double w; 		 		width = 0;@@ -281,7 +281,7 @@ public class AbstractMenu : GLib.Object { 			 			w = item.label.get_extent (); 			w += key_binding.get_extent ();-			w += 3 * height * MainWindow.units;+			w += 3 * height; 			 			if (w > width) { 				width = w;@@ -306,7 +306,7 @@ public class AbstractMenu : GLib.Object { 		 		x = allocation.width - width; 		y = 0;-		font_size = 17 * MainWindow.units;+		font_size = 17; 		this.allocation = allocation; 		 		foreach (MenuItem item in current_menu.items) {@@ -317,15 +317,15 @@ public class AbstractMenu : GLib.Object { 			cr.restore (); 			 			cr.save ();-			label_x = allocation.width - width + 0.7 * height * MainWindow.units;-			label_y = y + font_size - 1 * MainWindow.units;+			label_x = allocation.width - width + 0.7 * height;+			label_y = y + font_size - 1; 			Theme.text_color (item.label, "Menu Foreground"); 			item.label.draw_at_baseline (cr, label_x, label_y); 			 			key_binding.set_text (item.get_key_bindings ()); 			key_binding.set_font_size (font_size); 			binding_extent = key_binding.get_extent ();-			label_x = x + width - binding_extent - 0.6 * height * MainWindow.units;+			label_x = x + width - binding_extent - 0.6 * height; 			key_binding.set_font_size (font_size); 			Theme.text_color (key_binding, "Menu Foreground"); 			key_binding.draw_at_baseline (cr, label_x, label_y);diff --git a/libbirdfont/BackgroundImage.vala b/libbirdfont/BackgroundImage.valaindex 6924ced..8b3577c 100644--- a/libbirdfont/BackgroundImage.vala+++ b/libbirdfont/BackgroundImage.vala@@ -665,14 +665,14 @@ public class BackgroundImage : GLib.Object {  		d = Path.distance (x, nx, y, ny); 		-		return d < 15 * MainWindow.units;+		return d < 15; 	}  	bool is_over_resize (double nx, double ny) { 		double x, y, size; 		bool inx, iny; 	-		size = 12 * MainWindow.units;+		size = 12;  		x = img_middle_x - (img_scale_x * get_img ().get_width () / 2); 		y = img_middle_y - (img_scale_y * get_img ().get_height () / 2);diff --git a/libbirdfont/Button.vala b/libbirdfont/Button.valaindex e86e0ab..39e39f9 100644--- a/libbirdfont/Button.vala+++ b/libbirdfont/Button.vala@@ -26,9 +26,9 @@ public class Button : Widget {  	public Button (string label, double margin_bottom = 0) { 		this.margin_bottom = margin_bottom;-		font_size =  17 * MainWindow.units;+		font_size =  17; 		this.label = new Text (label, font_size);-		padding = 15 * MainWindow.units;+		padding = 15; 	}  	public override void draw (Context cr) {	@@ -47,7 +47,7 @@ public class Button : Widget {  		cr.save (); 		Theme.text_color (label, "Button Foreground");-		label.draw_at_top (cr, widget_x + padding, widget_y + (2 * padding - font_size - 3 * MainWindow.units) / 2.0);+		label.draw_at_top (cr, widget_x + padding, widget_y + (2 * padding - font_size - 3) / 2.0); 		cr.restore (); 	} diff --git a/libbirdfont/CheckBox.vala b/libbirdfont/CheckBox.valaindex 22dc7ac..8aeb5c8 100644--- a/libbirdfont/CheckBox.vala+++ b/libbirdfont/CheckBox.vala@@ -21,10 +21,10 @@ public class CheckBox : Widget { 	 	public bool checked = false; 	public signal void updated (bool checked);-	public double padding = 3.333 * MainWindow.units;+	public double padding = 3.333; 	-	public double w = 12 * MainWindow.units;-	public double h = 12 * MainWindow.units;+	public double w = 12;+	public double h = 12; 	 	bool has_focus = false; 	diff --git a/libbirdfont/DescriptionDisplay.vala b/libbirdfont/DescriptionDisplay.valaindex 60ffd5c..41fe1d3 100644--- a/libbirdfont/DescriptionDisplay.vala+++ b/libbirdfont/DescriptionDisplay.vala@@ -41,9 +41,9 @@ public class DescriptionDisplay : TableLayout { 	private static bool disable_copyright = false; 	 	public DescriptionDisplay () {-		double margin = 12 * MainWindow.units;-		double label_size = 20 * MainWindow.units;-		double label_margin = 4 * MainWindow.units;+		double margin = 12;+		double label_size = 20;+		double label_margin = 4; 		Headline headline; 		Font font = BirdFont.get_current_font (); 		@@ -66,7 +66,7 @@ public class DescriptionDisplay : TableLayout { 		designer_url = new LineTextArea (label_size); 	 		headline = new Headline (t_("Name and Description"));-		headline.margin_bottom = 20 * MainWindow.units;+		headline.margin_bottom = 20; 		widgets.add (headline);  		widgets.add (new Text (t_("PostScript Name"), label_size, label_margin));diff --git a/libbirdfont/ExportSettings.vala b/libbirdfont/ExportSettings.valaindex 28750c4..f4c00f4 100644--- a/libbirdfont/ExportSettings.vala+++ b/libbirdfont/ExportSettings.vala@@ -32,16 +32,16 @@ public class ExportSettings : TableLayout { 	public ExportSettings () { 		Headline headline; 		Font font;-		double margin = 12 * MainWindow.units;-		double label_size = 20 * MainWindow.units;-		double label_margin = 4 * MainWindow.units;+		double margin = 12;+		double label_size = 20;+		double label_margin = 4; 		string fn, folder; 		 		font = BirdFont.get_current_font ();		 		font.settings.set_setting ("has_export_settings", "true"); 		 		headline = new Headline (t_("Export Settings"));-		headline.margin_bottom = 20 * MainWindow.units;+		headline.margin_bottom = 20; 		widgets.add (headline); 		 		widgets.add (new Text (t_("File Name"), label_size, label_margin));@@ -94,7 +94,7 @@ public class ExportSettings : TableLayout {  		folder = ExportTool.get_export_folder (); 		Text folder_row = new Text (t_("Folder") + ": "  + folder, label_size, label_margin);-		folder_row.margin_bottom = 20 * MainWindow.units;+		folder_row.margin_bottom = 20; 		widgets.add (folder_row); 		 		widgets.add (new Text (t_("Formats"), label_size, label_margin));@@ -147,7 +147,7 @@ public class ExportSettings : TableLayout { 		widgets.add (svg); 		focus_ring.add (svg); -		svg.margin_bottom = 20 * MainWindow.units;+		svg.margin_bottom = 20;  		widgets.add (new Text (t_("Color Tables"), label_size, label_margin)); @@ -173,7 +173,7 @@ public class ExportSettings : TableLayout { 		widgets.add (colr_table); 		focus_ring.add (colr_table); 	-		colr_table.margin_bottom = 20 * MainWindow.units;+		colr_table.margin_bottom = 20;  		name_tab = new Button (t_("Name and Description"), margin); 		name_tab.action.connect ((c) => {diff --git a/libbirdfont/Headline.vala b/libbirdfont/Headline.valaindex 4d6ef37..e5c77ac 100644--- a/libbirdfont/Headline.vala+++ b/libbirdfont/Headline.vala@@ -29,19 +29,19 @@ class Headline : Widget { 	public override void draw (Context cr) { 		cr.save (); 		Theme.color (cr, "Headline Background");-		cr.rectangle (0, widget_y, allocation.width, 40 * MainWindow.units);+		cr.rectangle (0, widget_y, allocation.width, 40); 		cr.fill (); 		cr.restore (); 			 		cr.save (); 		label.set_source_rgba (1, 1, 1, 1);-		label.set_font_size (20 * MainWindow.units);-		label.draw_at_baseline (cr, 21 * MainWindow.units, widget_y + 25 * MainWindow.units);+		label.set_font_size (20);+		label.draw_at_baseline (cr, 21, widget_y + 25); 		cr.restore (); 	} 	 	public override double get_height () {-		return 40 * MainWindow.units;+		return 40; 	} 	 	public override double get_width () {diff --git a/libbirdfont/KerningDisplay.vala b/libbirdfont/KerningDisplay.valaindex 89c0f87..bb1d3ec 100644--- a/libbirdfont/KerningDisplay.vala+++ b/libbirdfont/KerningDisplay.vala@@ -301,7 +301,7 @@ public class KerningDisplay : FontDisplay { 				cr.stroke (); 				cr.restore (); 				-				y += (50 / KerningTools.font_size) * MainWindow.units;+				y += (50 / KerningTools.font_size); 			} 						 			y += row_height + 20;@@ -329,7 +329,7 @@ public class KerningDisplay : FontDisplay {  	private void display_kerning_value (double k) { 		string kerning = round (k);-		kerning_label = new Text (@"$(kerning)", 17 * MainWindow.units);+		kerning_label = new Text (@"$(kerning)", 17); 	} 	 	private void set_active_handle_index (int h) {diff --git a/libbirdfont/LicenseDialog.vala b/libbirdfont/LicenseDialog.valaindex 8e024f0..6131a7f 100644--- a/libbirdfont/LicenseDialog.vala+++ b/libbirdfont/LicenseDialog.vala@@ -95,14 +95,14 @@ public class LicenseDialog : Dialog { 		 		cr.save (); 		Theme.color (cr, "Dialog Background");-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.fill (); 		cr.restore (); 		 		cr.save (); 		Theme.color (cr, "Button Border 4"); 		cr.set_line_width (1);-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.stroke (); 		cr.restore (); diff --git a/libbirdfont/Line.vala b/libbirdfont/Line.valaindex e8f37c6..fa4cd01 100644--- a/libbirdfont/Line.vala+++ b/libbirdfont/Line.vala@@ -221,8 +221,8 @@ public class Line : GLib.Object { 		} 		 		if (is_vertical ()) { // over line handle (y)-			if (y > g.allocation.height - 10 * MainWindow.units-				||  y < 10 * MainWindow.units) {+			if (y > g.allocation.height - 10+				||  y < 10) { 					 				p = pos; 				c = Glyph.path_coordinate_x (x);@@ -236,8 +236,8 @@ public class Line : GLib.Object { 			set_active (a); 			 		} else { // over line handle (x)-			if (x > g.allocation.width - 10 * MainWindow.units-				|| x < 10 * MainWindow.units) {+			if (x > g.allocation.width - 10+				|| x < 10) { 					 				p = pos; 				c = Glyph.path_coordinate_y (y);@@ -414,17 +414,17 @@ public class Line : GLib.Object { 		 		// Label 		if (get_active ()) { -			line_label = new Text (translated_label, 19 * MainWindow.units);+			line_label = new Text (translated_label, 19);  			if (is_vertical ()) {-				line_label.widget_x = p + 8 * MainWindow.units;-				line_label.widget_y = allocation.height - 55 * MainWindow.units;+				line_label.widget_x = p + 8;+				line_label.widget_y = allocation.height - 55; 			} else { 				line_label.widget_x = g.allocation.width -					- 10 * MainWindow.units +					- 10  					- line_label.get_extent (); 					-				line_label.widget_y = p + 10 * MainWindow.units;+				line_label.widget_y = p + 10; 			} 			 			if (active) {diff --git a/libbirdfont/MessageDialog.vala b/libbirdfont/MessageDialog.valaindex 75e8e3f..f48bf1e 100644--- a/libbirdfont/MessageDialog.vala+++ b/libbirdfont/MessageDialog.vala@@ -24,14 +24,14 @@ public class MessageDialog : Dialog { 	 	public MessageDialog (string message) { 		Color c = Theme.get_color ("Text Tool Box");-		this.message = new TextArea (20 * MainWindow.units, c);+		this.message = new TextArea (20, c); 		this.message.set_text (message); 		this.message.draw_border = false; 		this.message.editable = false; 		this.message.carret_is_visible = false;-		this.message.min_width = 300 * MainWindow.units;+		this.message.min_width = 300; 		this.message.width = this.message.min_width;-		this.message.min_height = 20 * MainWindow.units;+		this.message.min_height = 20; 		this.message.height = this.message.min_height;  		ok_button = new Button (t_("Close"));@@ -50,11 +50,11 @@ public class MessageDialog : Dialog { 		message.layout ();  		width = message.get_width ();-		width += 10 * MainWindow.units;+		width += 10; 		 		height = message.get_height (); 		height += ok_button.get_height ();-		height += 5 * MainWindow.units;+		height += 5;   		cx = (allocation.width - width) / 2.0; 		cy = (allocation.height - height) / 2.0;@@ -67,25 +67,25 @@ public class MessageDialog : Dialog { 		 		cr.save (); 		Theme.color (cr, "Dialog Background");-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.fill (); 		cr.restore (); 		 		cr.save (); 		Theme.color (cr, "Foreground 1"); 		cr.set_line_width (1);-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.stroke (); 		cr.restore (); -		cy += 5 * MainWindow.units;-		message.widget_x = cx + 10 * MainWindow.units;+		cy += 5;+		message.widget_x = cx + 10; 		message.widget_y = cy; 		message.allocation = allocation; 		message.layout (); 		message.draw (cr); 	-		ok_button.widget_x = cx + 10 * MainWindow.units;+		ok_button.widget_x = cx + 10; 		ok_button.widget_y = cy + message.get_height (); 		ok_button.draw (cr); 	}diff --git a/libbirdfont/OverwriteDialog.vala b/libbirdfont/OverwriteDialog.valaindex 56536bc..dc9c8ce 100644--- a/libbirdfont/OverwriteDialog.vala+++ b/libbirdfont/OverwriteDialog.vala@@ -31,7 +31,7 @@ public class OverwriteDialog : Dialog { 	const double question_font_size = 23; 	 	public OverwriteDialog (OverWriteDialogListener callbacks) {-		double font_size = question_font_size * MainWindow.units;+		double font_size = question_font_size; 		 		listener = callbacks; 		@@ -55,7 +55,7 @@ public class OverwriteDialog : Dialog { 			callbacks.overwrite_dont_ask_again (); 		}); 		-		height = 90 * MainWindow.units;+		height = 90; 	}  	public override void layout () {@@ -64,33 +64,33 @@ public class OverwriteDialog : Dialog { 		double center; 		double qh; 			-		cx = 20 * MainWindow.units;+		cx = 20; 		overwrite_button.widget_x = cx; -		cx += 10 * MainWindow.units + overwrite_button.get_width ();+		cx += 10 + overwrite_button.get_width (); 		cancel_button.widget_x = cx; -		cx += 10 * MainWindow.units + cancel_button.get_width ();+		cx += 10 + cancel_button.get_width (); 		dont_ask_again_button.widget_x = cx; -		width = cx + 20 * MainWindow.units + dont_ask_again_button.get_width ();+		width = cx + 20 + dont_ask_again_button.get_width (); 		 		center = (allocation.width - width) / 2.0; 		 		question.widget_x = overwrite_button.widget_x + center;-		question.widget_y = cy + 15 * MainWindow.units;+		question.widget_y = cy + 15; 		Theme.text_color (question, "Text Tool Box"); 		-		qh = (question_font_size + 1) * MainWindow.units;+		qh = (question_font_size + 1); 		 		overwrite_button.widget_x += center;-		overwrite_button.widget_y = cy + qh + 25 * MainWindow.units;+		overwrite_button.widget_y = cy + qh + 25; 		 		cancel_button.widget_x += center;-		cancel_button.widget_y = cy + qh + 25 * MainWindow.units;+		cancel_button.widget_y = cy + qh + 25; 		 		dont_ask_again_button.widget_x += center;-		dont_ask_again_button.widget_y = cy + qh + 25 * MainWindow.units;+		dont_ask_again_button.widget_y = cy + qh + 25; 	}  	public override void draw (Context cr) {	@@ -109,14 +109,14 @@ public class OverwriteDialog : Dialog { 		 		cr.save (); 		Theme.color (cr, "Dialog Background");-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.fill (); 		cr.restore (); 		 		cr.save (); 		Theme.color (cr, "Button Border 4"); 		cr.set_line_width (1);-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.stroke (); 		cr.restore (); diff --git a/libbirdfont/PenTool.vala b/libbirdfont/PenTool.valaindex ac29c73..dcfc92b 100644--- a/libbirdfont/PenTool.vala+++ b/libbirdfont/PenTool.vala@@ -212,7 +212,7 @@ public class PenTool : Tool { 			selection_box_last_x = x; 			selection_box_last_y = y; -			if (Path.distance (begin_action_x, x, begin_action_y, y) > 10 * MainWindow.units) {+			if (Path.distance (begin_action_x, x, begin_action_y, y) > 10) { 				point_selection_image = false; 			} @@ -311,7 +311,7 @@ public class PenTool : Tool { 	public static bool can_join (EditPoint ep) { 		double mx, my; 		get_tie_position (ep, out mx, out my);-		return (mx > -10 * MainWindow.units && my > -10 * MainWindow.units);+		return (mx > -10 && my > -10); 	}  	public static void select_points_in_box () {@@ -1532,7 +1532,7 @@ public class PenTool : Tool {  		distance = sqrt (fabs (pow (px - x, 2)) + fabs (pow (py - y, 2))); 		-		return (distance < 7 * MainWindow.units);+		return (distance < 7); 	}  	/** Show the user that curves will be merged on release. */diff --git a/libbirdfont/QuestionDialog.vala b/libbirdfont/QuestionDialog.valaindex b6e0c13..c92537b 100644--- a/libbirdfont/QuestionDialog.vala+++ b/libbirdfont/QuestionDialog.vala@@ -97,14 +97,14 @@ public class QuestionDialog : Dialog { 		 		cr.save (); 		Theme.color (cr, "Dialog Background");-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.fill (); 		cr.restore (); 		 		cr.save (); 		Theme.color (cr, "Button Border 4"); 		cr.set_line_width (1);-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.stroke (); 		cr.restore (); diff --git a/libbirdfont/ResizeTool.vala b/libbirdfont/ResizeTool.valaindex 22fffd0..37af75f 100644--- a/libbirdfont/ResizeTool.vala+++ b/libbirdfont/ResizeTool.vala@@ -298,8 +298,8 @@ public class ResizeTool : Tool { 		hx = cos (rotation) * get_rotated_handle_length (); 		hy = sin (rotation) * get_rotated_handle_length (); -		inx = x - size * MainWindow.units <= cx + hx - 2.5 <= x + size * MainWindow.units;-		iny = y - size * MainWindow.units <= cy + hy - 2.5 <= y + size * MainWindow.units;+		inx = x - size <= cx + hx - 2.5 <= x + size;+		iny = y - size <= cy + hy - 2.5 <= y + size; 		 		return inx && iny; 	}@@ -519,13 +519,13 @@ public class ResizeTool : Tool { 	bool is_over_resize_handle (Path p, double x, double y) { 		double handle_x, handle_y; 		get_resize_handle_position (out handle_x, out handle_y);-		return Path.distance (handle_x, x, handle_y, y) < 12 * MainWindow.units;+		return Path.distance (handle_x, x, handle_y, y) < 12; 	}  	bool is_over_horizontal_resize_handle (Path p, double x, double y) { 		double handle_x, handle_y; 		get_horizontal_reseize_handle_position (out handle_x, out handle_y);-		return Path.distance (handle_x, x, handle_y, y) < 12 * MainWindow.units;		+		return Path.distance (handle_x, x, handle_y, y) < 12;		 	}  	public void skew (double skew) {diff --git a/libbirdfont/Row.vala b/libbirdfont/Row.valaindex b668ec1..43a3338 100644--- a/libbirdfont/Row.vala+++ b/libbirdfont/Row.vala@@ -37,28 +37,28 @@ public class Row : GLib.Object { 	 	public Row (string label, int index, bool delete_button = true) { 		this.index = index;-		column_text.add (new Text (label, 18 * MainWindow.units));+		column_text.add (new Text (label, 18)); 		this.delete_button = delete_button; 	}  	public Row.headline (string label) { 		index = -1;-		column_text.add (new Text (label, 25 * MainWindow.units));+		column_text.add (new Text (label, 25)); 		delete_button = false; 		is_headline = true; 	} 	 	public Row.columns_1 (string label, int index, bool delete_button = true) { 		this.index = index;-		column_text.add (new Text (label, 18 * MainWindow.units));+		column_text.add (new Text (label, 18)); 		this.delete_button = delete_button; 	} 	 	public Row.columns_2 (string label0, string label1, int index, 		bool delete_button = true) { 			-		column_text.add (new Text (label0, 18 * MainWindow.units));-		column_text.add (new Text (label1, 18 * MainWindow.units));+		column_text.add (new Text (label0, 18));+		column_text.add (new Text (label1, 18)); 		this.index = index; 		this.delete_button = delete_button; 	}@@ -66,9 +66,9 @@ public class Row : GLib.Object { 	public Row.columns_3 (string label0, string label1, string label2, 		int index, bool delete_button = true) { 			-		column_text.add (new Text (label0, 18 * MainWindow.units));-		column_text.add (new Text (label1, 18 * MainWindow.units));-		column_text.add (new Text (label2, 18 * MainWindow.units));+		column_text.add (new Text (label0, 18));+		column_text.add (new Text (label1, 18));+		column_text.add (new Text (label2, 18)); 		this.index = index; 		this.delete_button = delete_button; 	}@@ -76,10 +76,10 @@ public class Row : GLib.Object { 	public Row.columns_4 (string label0, string label1, string label2,  		string label3, int index, bool delete_button = true) { 			-		column_text.add (new Text (label0, 18 * MainWindow.units));-		column_text.add (new Text (label1, 18 * MainWindow.units));-		column_text.add (new Text (label2, 18 * MainWindow.units));-		column_text.add (new Text (label3, 18 * MainWindow.units));+		column_text.add (new Text (label0, 18));+		column_text.add (new Text (label1, 18));+		column_text.add (new Text (label2, 18));+		column_text.add (new Text (label3, 18)); 		this.index = index; 		this.delete_button = delete_button; 	}@@ -87,11 +87,11 @@ public class Row : GLib.Object { 	public Row.columns_5 (string label0, string label1, string label2, 		string label3, string label4, int index, bool delete_button = true) { 			-		column_text.add (new Text (label0, 18 * MainWindow.units));-		column_text.add (new Text (label1, 18 * MainWindow.units));-		column_text.add (new Text (label2, 18 * MainWindow.units));-		column_text.add (new Text (label3, 18 * MainWindow.units));-		column_text.add (new Text (label4, 18 * MainWindow.units));+		column_text.add (new Text (label0, 18));+		column_text.add (new Text (label1, 18));+		column_text.add (new Text (label2, 18));+		column_text.add (new Text (label3, 18));+		column_text.add (new Text (label4, 18)); 		this.index = index; 		this.delete_button = delete_button; 	}@@ -126,7 +126,7 @@ public class Row : GLib.Object { 	} 	 	public double get_height () {-		return is_headline ? 75 * MainWindow.units : 25 * MainWindow.units;+		return is_headline ? 75 : 25; 	} } diff --git a/libbirdfont/SaveDialog.vala b/libbirdfont/SaveDialog.valaindex cd65f26..9bb4207 100644--- a/libbirdfont/SaveDialog.vala+++ b/libbirdfont/SaveDialog.vala@@ -33,7 +33,7 @@ public class SaveDialog : Dialog { 	public SaveDialog (SaveDialogListener callbacks) { 		listener = callbacks; 		-		save_question = new Text (t_("Save changes?"), question_font_size * MainWindow.units);+		save_question = new Text (t_("Save changes?"), question_font_size); 		 		save_button = new Button (t_("Save")); 		save_button.action.connect (() => {@@ -53,7 +53,7 @@ public class SaveDialog : Dialog { 			callbacks.signal_cancel (); 		}); 		-		height = 90 * MainWindow.units;+		height = 90; 	}  	public override void layout () {@@ -62,33 +62,33 @@ public class SaveDialog : Dialog { 		double center; 		double qh; 		-		cx = 20 * MainWindow.units;+		cx = 20; 		save_button.widget_x = cx; -		cx += 10 * MainWindow.units + save_button.get_width ();+		cx += 10 + save_button.get_width (); 		discard_button.widget_x = cx; -		cx += 10 * MainWindow.units + discard_button.get_width ();+		cx += 10 + discard_button.get_width (); 		cancel_button.widget_x = cx; -		width = cx + 20 * MainWindow.units + cancel_button.get_width ();;+		width = cx + 20 + cancel_button.get_width ();; 		 		center = (allocation.width - width) / 2.0; 		 		save_question.widget_x = save_button.widget_x + center;-		save_question.widget_y = cy + 15 * MainWindow.units;+		save_question.widget_y = cy + 15; 		Theme.text_color (save_question, "Text Tool Box"); 		-		qh = (question_font_size + 1) * MainWindow.units;+		qh = (question_font_size + 1); 		 		save_button.widget_x += center;-		save_button.widget_y = cy + qh + 25 * MainWindow.units;+		save_button.widget_y = cy + qh + 25; 		 		discard_button.widget_x += center;-		discard_button.widget_y = cy + qh + 25 * MainWindow.units;+		discard_button.widget_y = cy + qh + 25; 		 		cancel_button.widget_x += center;-		cancel_button.widget_y = cy + qh + 25 * MainWindow.units;+		cancel_button.widget_y = cy + qh + 25; 	}  	public override void draw (Context cr) {	@@ -107,14 +107,14 @@ public class SaveDialog : Dialog { 		 		cr.save (); 		Theme.color (cr, "Dialog Background");-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.fill (); 		cr.restore (); 		 		cr.save (); 		Theme.color (cr, "Button Border 4"); 		cr.set_line_width (1);-		draw_rounded_rectangle (cr, cx, cy, width, height, 10 * MainWindow.units);+		draw_rounded_rectangle (cr, cx, cy, width, height, 10); 		cr.stroke (); 		cr.restore (); diff --git a/libbirdfont/SettingsDisplay.vala b/libbirdfont/SettingsDisplay.valaindex 9ed74aa..36a8ff4 100644--- a/libbirdfont/SettingsDisplay.vala+++ b/libbirdfont/SettingsDisplay.vala@@ -53,7 +53,7 @@ internal abstract class SettingsDisplay : FontDisplay { 		cr.restore (); 		 		foreach (SettingsItem s in tools) {-			if (-20 * MainWindow.units <= s.y <= allocation.height + 20 * MainWindow.units) {+			if (-20 <= s.y <= allocation.height + 20) { 				s.draw (allocation, cr); 			} 		}@@ -65,20 +65,20 @@ internal abstract class SettingsDisplay : FontDisplay { 		foreach (SettingsItem s in tools) { 			 			if (!first && s.headline) {-				y += 30 * MainWindow.units;+				y += 30; 			} 			 			s.y = y; 			 			if (s.button != null) { 				((!) s.button).y = y;-				((!) s.button).x = 20 * MainWindow.units;+				((!) s.button).x = 20; 			} 			 			if (s.headline) {-				y += 50 * MainWindow.units;+				y += 50; 			} else {-				y += 40 * MainWindow.units;+				y += 40; 			} 			 			first = false;@@ -181,7 +181,7 @@ internal abstract class SettingsDisplay : FontDisplay { 				((!) s.button).panel_release_action (((!) s.button), button, x, y); 			} 			-			if (s.key_bindings && s.y <= y < s.y + 40 * MainWindow.units && button == 1) {+			if (s.key_bindings && s.y <= y < s.y + 40 && button == 1) { 				set_key_bindings (s); 			} 		}@@ -254,7 +254,7 @@ internal abstract class SettingsDisplay : FontDisplay { 			}		 		} 		-		scroll -= dy * MainWindow.units;+		scroll -= dy;  		if (scroll + allocation.height >=  content_height) { 			scroll = content_height - allocation.height;diff --git a/libbirdfont/SettingsItem.vala b/libbirdfont/SettingsItem.valaindex 816e8cc..c38f15a 100644--- a/libbirdfont/SettingsItem.vala+++ b/libbirdfont/SettingsItem.vala@@ -91,20 +91,20 @@ public class SettingsItem : GLib.Object { 		if (headline) { 			cr.save (); 			Theme.color (cr, "Headline Background");-			cr.rectangle (0, y, allocation.width, 40 * MainWindow.units);+			cr.rectangle (0, y, allocation.width, 40); 			cr.fill (); 			cr.restore (); 				 			cr.save (); 			Theme.text_color (label, "Foreground Inverted");-			label.set_font_size (20 * MainWindow.units);-			label.draw_at_baseline (cr, 21 * MainWindow.units, y + 25 * MainWindow.units);+			label.set_font_size (20);+			label.draw_at_baseline (cr, 21, y + 25); 			cr.restore (); 		} else { 			if (active) { 				cr.save (); 				Theme.color (cr, "Menu Background");-				cr.rectangle (0, y - 5 * MainWindow.units, allocation.width, 40 * MainWindow.units);+				cr.rectangle (0, y - 5, allocation.width, 40); 				cr.fill (); 				cr.restore (); 			}@@ -119,8 +119,8 @@ public class SettingsItem : GLib.Object { 			 			cr.save (); 			Theme.text_color (label, "Text Tool Box");-			label.set_font_size (17 * MainWindow.units);-			label.draw_at_baseline (cr, label_x, y + 20 * MainWindow.units);+			label.set_font_size (17);+			label.draw_at_baseline (cr, label_x, y + 20); 			cr.restore (); 			 			if (key_bindings) {@@ -134,9 +134,9 @@ public class SettingsItem : GLib.Object { 					Theme.text_color (key_binding_text, "Text Tool Box"); 				} 				-				key_binding_text.set_font_size (17 * MainWindow.units);-				label_x += label.get_extent () + 20 * MainWindow.units;-				key_binding_text.draw_at_baseline (cr, label_x, y + 20 * MainWindow.units);+				key_binding_text.set_font_size (17);+				label_x += label.get_extent () + 20;+				key_binding_text.draw_at_baseline (cr, label_x, y + 20); 				cr.restore (); 			}	 		}diff --git a/libbirdfont/SpacingTab.vala b/libbirdfont/SpacingTab.valaindex 2613d5d..90922b5 100644--- a/libbirdfont/SpacingTab.vala+++ b/libbirdfont/SpacingTab.vala@@ -19,9 +19,9 @@ namespace BirdFont { /** Kerning context. */ public class SpacingTab : KerningDisplay { -	double box_size = 122 * MainWindow.units;-	double height = 44 * MainWindow.units;-	double character_height = 20 * MainWindow.units;+	double box_size = 122;+	double height = 44;+	double character_height = 20; 	 	WidgetAllocation allocation; 	@@ -114,7 +114,7 @@ public class SpacingTab : KerningDisplay { 			cap = new Text ((!) c.to_string (), 17); 			Theme.text_color (cap, "Table Border"); 			cap.widget_x = middle - cap.get_extent () / 2.0;-			cap.widget_y = allocation.height - height + character_height - 4 * MainWindow.units;+			cap.widget_y = allocation.height - height + character_height - 4; 			cap.draw_at_baseline (cr, cap.widget_x, cap.widget_y);			 			 			l = g.get_left_side_bearing ();@@ -126,7 +126,7 @@ public class SpacingTab : KerningDisplay { 			left = new Text (truncate (l, 5), 17); 			Theme.text_color (left, "Foreground 1"); 			left.widget_x = middle - box_size / 2.0 + (box_size / 2.0 - left.get_extent ()) / 2.0;-			left.widget_y = allocation.height - 7 * MainWindow.units;+			left.widget_y = allocation.height - 7; 			left.draw_at_baseline (cr, left.widget_x, left.widget_y);  			r = g.get_right_side_bearing ();@@ -138,7 +138,7 @@ public class SpacingTab : KerningDisplay { 			right = new Text (truncate (r, 5), 17); 			Theme.text_color (right, "Table Border"); 			right.widget_x = end - (box_size / 2.0 - right.get_extent ()) / 2.0 - right.get_extent ();-			right.widget_y = allocation.height - 7 * MainWindow.units;+			right.widget_y = allocation.height - 7; 			right.draw_at_baseline (cr, right.widget_x, right.widget_y);					 		} 	}diff --git a/libbirdfont/TabContent.vala b/libbirdfont/TabContent.valaindex 34354b3..b668619 100644--- a/libbirdfont/TabContent.vala+++ b/libbirdfont/TabContent.vala@@ -417,7 +417,7 @@ public class TabContent : GLib.Object { 		text_callback = tl;  		text_input_label = new Text (tl.label);-		text_input = new LineTextArea (20 * MainWindow.units);+		text_input = new LineTextArea (20); 		text_input_button = new Button (tl.button_label);  		text_input.carret_is_visible = true;diff --git a/libbirdfont/Table.vala b/libbirdfont/Table.valaindex 9a237b5..4816fe7 100644--- a/libbirdfont/Table.vala+++ b/libbirdfont/Table.vala@@ -82,10 +82,10 @@ public abstract class Table : FontDisplay { 			 			for (int i = 0; i < row.columns; i++) { 				width = (int) row.get_column (i).get_sidebearing_extent ();-				width +=  (int) (10 * MainWindow.units);+				width +=  (int) (10); 				-				if (width < 100 * MainWindow.units) {-					width = (int) (100 * MainWindow.units);+				if (width < 100) {+					width = (int) (100); 				} 				 				if (width > column_width.get (i)) {@@ -106,8 +106,8 @@ public abstract class Table : FontDisplay { 		cr.save (); 		Theme.color (cr, "Text Foreground"); 		t = row.get_column (0);-		t.widget_x = 40 * MainWindow.units;-		t.widget_y = y + 45 * MainWindow.units;+		t.widget_x = 40;+		t.widget_y = y + 45; 		t.draw (cr);		 		cr.restore (); 		@@ -127,7 +127,7 @@ public abstract class Table : FontDisplay { 			Theme.color (cr, "Table Background 1"); 		} 		-		cr.rectangle (0, y, allocation.width, 25 * MainWindow.units);+		cr.rectangle (0, y, allocation.width, 25); 		cr.fill (); 		cr.restore (); @@ -135,23 +135,23 @@ public abstract class Table : FontDisplay { 			cr.save (); 			Theme.color (cr, "Foreground 1"); 			cr.set_line_width (1);-			cr.move_to (10 * MainWindow.units, y + 15 * MainWindow.units);-			cr.line_to (15 * MainWindow.units, y + 10 * MainWindow.units);-			cr.move_to (10 * MainWindow.units, y + 10 * MainWindow.units);-			cr.line_to (15 * MainWindow.units, y + 15 * MainWindow.units);		+			cr.move_to (10, y + 15);+			cr.line_to (15, y + 10);+			cr.move_to (10, y + 10);+			cr.line_to (15, y + 15);		 			cr.stroke (); 			cr.restore (); 		} 		 		return_if_fail (row.columns <= column_width.size); 		-		x = 40 * MainWindow.units;+		x = 40; 		for (int i = 0; i < row.columns; i++) { 			cr.save (); 			Theme.color (cr, "Foreground 1"); 			t = row.get_column (i); 			t.widget_x = x;-			t.widget_y = y + 3 * MainWindow.units;+			t.widget_y = y + 3; 			t.draw (cr); 			 			x += column_width.get (i); @@ -211,7 +211,7 @@ public abstract class Table : FontDisplay { 	} 	 	public override void scroll_wheel (double x, double y, double pixeldelta, double dy) {-		scroll -= dy * MainWindow.units;+		scroll -= dy;  		if (scroll > page_height - allocation.height) { 			scroll = page_height - allocation.height;diff --git a/libbirdfont/TableLayout.vala b/libbirdfont/TableLayout.valaindex 7dc73d3..298535a 100644--- a/libbirdfont/TableLayout.vala+++ b/libbirdfont/TableLayout.vala@@ -66,7 +66,7 @@ public class TableLayout : FontDisplay { 		double y = -scroll; 		 		foreach (Widget w in widgets) {-			w.widget_x = 17 * MainWindow.units;+			w.widget_x = 17; 			w.widget_y = y; 			w.allocation = allocation; 			@@ -223,7 +223,7 @@ public class TableLayout : FontDisplay { 	} 	 	public override void scroll_wheel (double x, double y, double pixeldelta, double dy) {-		scroll -= dy * MainWindow.units;+		scroll -= dy; 		 		if (scroll + allocation.height >=  content_height) { 			scroll = content_height - allocation.height;

Contact

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