mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Merge pull request #47 from SbNanduri/line-tool
Fix for crashes that occur when using selection tool and line tool
This commit is contained in:
commit
4ef0370d6c
|
@ -257,8 +257,8 @@ func _process(delta : float) -> void:
|
||||||
is_making_line = true
|
is_making_line = true
|
||||||
elif Input.is_action_just_released("shift"):
|
elif Input.is_action_just_released("shift"):
|
||||||
is_making_line = false
|
is_making_line = false
|
||||||
line_2d.queue_free()
|
if is_instance_valid(line_2d):
|
||||||
|
line_2d.queue_free()
|
||||||
if is_making_line:
|
if is_making_line:
|
||||||
line_2d.set_point_position(1, mouse_pos)
|
line_2d.set_point_position(1, mouse_pos)
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ func _process(delta : float) -> void:
|
||||||
update()
|
update()
|
||||||
|
|
||||||
# Makes line2d invisible
|
# Makes line2d invisible
|
||||||
if weakref(Global.canvas.line_2d).get_ref(): # Checks to see if line_2d object still exists
|
if is_instance_valid(Global.canvas.line_2d): # Checks to see if line_2d object still exists
|
||||||
Global.canvas.line_2d.default_color = Color(0, 0, 0, 0)
|
Global.canvas.line_2d.default_color = Color(0, 0, 0, 0)
|
||||||
else:
|
else:
|
||||||
get_parent().get_parent().mouse_default_cursor_shape = Input.CURSOR_ARROW
|
get_parent().get_parent().mouse_default_cursor_shape = Input.CURSOR_ARROW
|
||||||
|
@ -104,7 +104,7 @@ func _process(delta : float) -> void:
|
||||||
Global.canvas.handle_redo("Rectangle Select") #Redo
|
Global.canvas.handle_redo("Rectangle Select") #Redo
|
||||||
|
|
||||||
# Makes line2d visible
|
# Makes line2d visible
|
||||||
if weakref(Global.canvas.line_2d).get_ref(): # Checks to see if line_2d object still exists
|
if is_instance_valid(Global.canvas.line_2d): # Checks to see if line_2d object still exists
|
||||||
Global.canvas.line_2d.default_color = Color.darkgray
|
Global.canvas.line_2d.default_color = Color.darkgray
|
||||||
|
|
||||||
#Handle copy
|
#Handle copy
|
||||||
|
|
Loading…
Reference in a new issue