Made changes to gd_paint demo based on feedback by aaronfranke

This commit is contained in:
TwistedTwigleg
2019-06-15 11:52:41 -04:00
parent 7ad43829ef
commit 2c5b4a48d0
2 changed files with 4 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ func _ready():
set_process(true)
func _process(delta):
func _process(_delta):
var mouse_pos = get_viewport().get_mouse_position()
# Check if the mouse is currently inside the canvas/drawing-area
@@ -135,6 +135,7 @@ func undo_stroke():
# Figure out how many elements/brushes we've added in the last stroke
var elements_to_remove = brush_data_list.size() - undo_element_list_num
# Remove all of the elements we've added this in the last stroke
#warning-ignore:unused_variable
for elment_num in range(0, elements_to_remove):
brush_data_list.pop_back()

View File

@@ -16,6 +16,7 @@ func _ready():
paint_control = get_parent().get_node("PaintControl")
save_dialog = get_parent().get_node("SaveFileDialog")
# warning-ignore-all:return_value_discarded
# Assign all of the needed signals for the oppersation buttons
get_node("ButtonUndo").connect("pressed", self, "button_pressed", ["undo_stroke"])
get_node("ButtonSave").connect("pressed", self, "button_pressed", ["save_picture"])
@@ -47,7 +48,7 @@ func _ready():
set_physics_process(true)
func _physics_process(delta):
func _physics_process(_delta):
# Update the status label with the newest brush element count
label_stats.text = "Brush objects: " + String(paint_control.brush_data_list.size())