From 582ed0329336881981f9cf58ce33146d39d9c600 Mon Sep 17 00:00:00 2001 From: Daniel Lewan Date: Mon, 6 Aug 2018 22:05:26 +0200 Subject: [PATCH] Fix removing gradient steps from colorize node also makes node a little bit bigger to contain whole gradient editor --- addons/procedural_material/nodes/colorize.tscn | 2 +- addons/procedural_material/widgets/gradient_editor.gd | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/procedural_material/nodes/colorize.tscn b/addons/procedural_material/nodes/colorize.tscn index 5146b5e..e63ec31 100644 --- a/addons/procedural_material/nodes/colorize.tscn +++ b/addons/procedural_material/nodes/colorize.tscn @@ -15,7 +15,7 @@ anchor_bottom = 0.0 margin_left = 1.0 margin_top = 4.0 margin_right = 133.0 -margin_bottom = 63.0 +margin_bottom = 72.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 1 diff --git a/addons/procedural_material/widgets/gradient_editor.gd b/addons/procedural_material/widgets/gradient_editor.gd index 8b7f554..fd952f3 100644 --- a/addons/procedural_material/widgets/gradient_editor.gd +++ b/addons/procedural_material/widgets/gradient_editor.gd @@ -11,10 +11,10 @@ class GradientCursor: rect_size = Vector2(WIDTH, 20) func _gui_input(ev): - if ev is InputEventMouseButton && ev.doubleclick: - if ev.button_index == 1: + if ev is InputEventMouseButton: + if ev.button_index == BUTTON_LEFT && ev.doubleclick: get_parent().select_color(self, ev.global_position) - elif ev.button_index == 2 && get_parent().get_sorted_cursors().size() > 2: + elif ev.button_index == BUTTON_RIGHT && get_parent().get_sorted_cursors().size() > 2: var parent = get_parent() parent.remove_child(self) parent.update_shader()