Updated Files
libbirdfont/BackgroundImage.vala |
libbirdfont/BackgroundTools.vala |
libbirdfont/DrawingTools.vala |
--- a/libbirdfont/BackgroundImage.vala
+++ b/libbirdfont/BackgroundImage.vala
@@ -366,7 +366,6 @@
if (get_img_rotation_from_coordinate (x, y, out rotation)) {
img_rotation = rotation;
backgounds = get_image ();
- double view_zoom = MainWindow.get_current_glyph ().view_zoom;
ImageSurface rotated;
img_rotation = rotation;
--- a/libbirdfont/BackgroundTools.vala
+++ b/libbirdfont/BackgroundTools.vala
@@ -40,17 +40,22 @@
parts.set_unique (true);
background_tools.add_tool (select_background);
+ select_background.select_action.connect (update_tool_selection);
+
+ background_tools.add_tool (DrawingTools.move_background);
+ DrawingTools.move_background.select_action.connect (update_tool_selection);
+ background_tools.add_tool (DrawingTools.move_canvas);
+ DrawingTools.move_canvas.select_action.connect (update_tool_selection);
+
+ background_tools.add_tool (DrawingTools.background_scale);
+
LabelTool add_new_image = new LabelTool (t_("Add"));
add_new_image.select_action.connect ((t) => {
load_image ();
});
background_selection.add_tool (add_new_image);
-
- background_tools.add_tool (DrawingTools.move_background);
- background_tools.add_tool (DrawingTools.move_canvas);
- background_tools.add_tool (DrawingTools.background_scale);
-
+
expanders.add (font_name);
expanders.add (background_tools);
expanders.add (DrawingTools.zoombar_tool);
@@ -58,6 +63,14 @@
expanders.add (background_selection);
expanders.add (files);
expanders.add (parts);
+ }
+
+ public void update_tool_selection (Tool selected) {
+ select_background.set_selected (false);
+ DrawingTools.move_background.set_selected (false);
+ DrawingTools.move_canvas.set_selected (false);
+ DrawingTools.background_scale.set_selected (false);
+ selected.set_selected (true);
}
public void remove_images () {
--- a/libbirdfont/DrawingTools.vala
+++ b/libbirdfont/DrawingTools.vala
@@ -1376,8 +1376,6 @@
idle.set_callback (() => {
Glyph g = MainWindow.get_current_glyph ();
-
- hide_all_modifiers ();
foreach (Tool t in draw_tools.tool) {
if (t != current_tool) {
@@ -1385,6 +1383,13 @@
}
}
+ FontDisplay display = MainWindow.get_current_display ();
+
+ if (display.get_name () == "Backgrounds") {
+ return false;
+ }
+
+ hide_all_modifiers ();
cut_background.set_selected (false);
bezier_tool.set_selected (false);