Clone in a terminal:
Commit 41b4f4b
Johan Mattsson - 2014-11-09T12:45:54+00:00
41b4f4b4410946a29ecedc3fea06902389047a07johan.mattsson.m@gmail.com

Delete background images

Changed files (4)

Diff

diff --git a/graphics/tools_and_buttons.svg b/graphics/tools_and_buttons.svgindex bb92363..5514f5c 100644--- a/graphics/tools_and_buttons.svg+++ b/graphics/tools_and_buttons.svg@@ -1523,9 +1523,9 @@      borderopacity="1.0"      inkscape:pageopacity="0.0"      inkscape:pageshadow="2"-     inkscape:zoom="25.134834"-     inkscape:cx="297.92082"-     inkscape:cy="210.59135"+     inkscape:zoom="4.4432529"+     inkscape:cx="411.21063"+     inkscape:cy="248.2595"      inkscape:current-layer="layer1"      inkscape:document-units="px"      showgrid="false"@@ -5525,5 +5525,13 @@        inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_resolution.png"        inkscape:export-xdpi="319"        inkscape:export-ydpi="319" />+    <path+       style="fill:#000000;fill-opacity:0;stroke:#656a73;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"+       d="m 406.78643,542.63457 -2.15625,2.25 4.1875,3.96875 -4.1875,3.96875 2.15625,2.25 4.28125,-4.0625 4.3125,4.0625 2.125,-2.25 -4.1875,-3.96875 4.1875,-3.96875 -2.125,-2.25 -4.3125,4.0625 -4.28125,-4.0625 z"+       id="rect3375-3"+       inkscape:connector-curvature="0"+       inkscape:export-filename="/home/johan/birdfont/icons/delete_background.png"+       inkscape:export-xdpi="319"+       inkscape:export-ydpi="319" />   </g> </svg>diff --git a/icons/delete_background.png b/icons/delete_background.pngnew file mode 100644index 0000000..e52efccBinary files /dev/null and b/icons/delete_background.png differdiff --git a/libbirdfont/DrawingTools.vala b/libbirdfont/DrawingTools.valaindex c41e015..4837266 100644--- a/libbirdfont/DrawingTools.vala+++ b/libbirdfont/DrawingTools.vala@@ -59,6 +59,7 @@ public class DrawingTools : ToolCollection  { 	SpinButton auto_trace_resolution; 	Tool auto_trace; 	SpinButton auto_trace_simplify;+	Tool delete_background;  	Tool rectangle; 	Tool circle;@@ -743,7 +744,14 @@ public class DrawingTools : ToolCollection  { 		});			 			 		draw_tool_modifiers.add_tool (auto_trace);		-		++		delete_background = new Tool ("delete_background", t_("Delete background image"));+		delete_background.select_action.connect ((self) => {+			MainWindow.get_current_glyph ().delete_background ();+		});			+			+		draw_tool_modifiers.add_tool (delete_background);	+				 		if (BirdFont.has_argument ("--test")) { 			Tool test_case = new Tool ("test_case"); 			test_case.select_action.connect((self) => {@@ -1244,6 +1252,7 @@ public class DrawingTools : ToolCollection  { 		auto_trace_resolution.set_tool_visibility (false); 		auto_trace.set_tool_visibility (false); 		auto_trace_simplify.set_tool_visibility (false);+		delete_background.set_tool_visibility (false); 	}  	void show_background_tool_modifiers () {@@ -1258,6 +1267,7 @@ public class DrawingTools : ToolCollection  { 		auto_trace_resolution.set_tool_visibility (true); 		auto_trace.set_tool_visibility (true); 		auto_trace_simplify.set_tool_visibility (true);+		delete_background.set_tool_visibility (true); 	} 			 	void show_point_tool_modifiers () {@@ -1311,6 +1321,7 @@ public class DrawingTools : ToolCollection  { 			stroke_tool.set_selected (false); 			track_tool.set_selected (false); 			move_canvas.set_selected (false);+			delete_background.set_selected (false); 			 			show_bg.set_selected (g.get_background_visible ()); 			show_bg.set_active (false);diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex 53aec7a..1438798 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -165,6 +165,12 @@ public class Glyph : FontDisplay { 		} 	} 	+	public void delete_background () {+		store_undo_state ();+		background_image = null;+		GlyphCanvas.redraw ();+	}+	 	public Path? get_active_path () { 		return_val_if_fail (active_paths.size > 0, null); 		return active_paths.get (active_paths.size - 1);

Contact

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