Fix removing gradient steps from colorize node

also makes node a little bit bigger to contain
whole gradient editor
This commit is contained in:
Daniel Lewan 2018-08-06 22:05:26 +02:00
parent cc1ccb8835
commit 582ed03293
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ anchor_bottom = 0.0
margin_left = 1.0 margin_left = 1.0
margin_top = 4.0 margin_top = 4.0
margin_right = 133.0 margin_right = 133.0
margin_bottom = 63.0 margin_bottom = 72.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 1 mouse_filter = 1

View File

@ -11,10 +11,10 @@ class GradientCursor:
rect_size = Vector2(WIDTH, 20) rect_size = Vector2(WIDTH, 20)
func _gui_input(ev): func _gui_input(ev):
if ev is InputEventMouseButton && ev.doubleclick: if ev is InputEventMouseButton:
if ev.button_index == 1: if ev.button_index == BUTTON_LEFT && ev.doubleclick:
get_parent().select_color(self, ev.global_position) 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() var parent = get_parent()
parent.remove_child(self) parent.remove_child(self)
parent.update_shader() parent.update_shader()