move selection cancel button to the start and clear selection on esc

This commit is contained in:
Crispy 2024-12-12 23:19:43 +01:00
parent 96f1a8367f
commit 859e39875a

View file

@ -720,15 +720,15 @@ impl Editor {
);
let y = footer_top as i32 + 49;
if simple_button(d, 100, y, 40, 40) {
self.save_blueprint(selection);
}
draw_scaled_texture(d, textures.get("save"), 104, y + 4, 2.);
if simple_button(d, 144, y, 40, 40) {
if simple_button(d, 100, y, 40, 40) || d.is_key_pressed(KeyboardKey::KEY_ESCAPE) {
self.active_tool = Tool::SelectArea(Selection::default());
}
draw_scaled_texture(d, textures.get("cancel"), 148, y + 4, 2.);
draw_scaled_texture(d, textures.get("cancel"), 104, y + 4, 2.);
if simple_button(d, 144, y, 40, 40) {
self.save_blueprint(selection);
}
draw_scaled_texture(d, textures.get("save"), 148, y + 4, 2.);
if simple_button(d, 188, y, 40, 40)
|| (d.is_key_pressed(KeyboardKey::KEY_C)