mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
When switching projects and the curve tool is active, clear it
Instead of applying it. This also fixes a crash when the curve tool is active and the current project closes
This commit is contained in:
parent
e1a53ed905
commit
2afb087b7a
|
@ -10,7 +10,7 @@ var _last_mouse_position := Vector2.INF ## The last position of the mouse
|
||||||
|
|
||||||
|
|
||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
Global.project_about_to_switch.connect(_draw_shape) # To prevent tool from remaining active
|
Global.project_about_to_switch.connect(_clear) # To prevent tool from remaining active
|
||||||
_drawer.color_op = Drawer.ColorOp.new()
|
_drawer.color_op = Drawer.ColorOp.new()
|
||||||
update_indicator()
|
update_indicator()
|
||||||
|
|
||||||
|
@ -174,10 +174,14 @@ func _draw_shape() -> void:
|
||||||
v.y = y
|
v.y = y
|
||||||
if Geometry2D.is_point_in_polygon(v, points):
|
if Geometry2D.is_point_in_polygon(v, points):
|
||||||
draw_tool(v)
|
draw_tool(v)
|
||||||
|
_clear()
|
||||||
|
commit_undo()
|
||||||
|
|
||||||
|
|
||||||
|
func _clear() -> void:
|
||||||
_curve.clear_points()
|
_curve.clear_points()
|
||||||
_drawing = false
|
_drawing = false
|
||||||
_editing_out_control_point = false
|
_editing_out_control_point = false
|
||||||
commit_undo()
|
|
||||||
|
|
||||||
|
|
||||||
## Get the [member _curve]'s baked points, and draw lines between them using [method _fill_gap].
|
## Get the [member _curve]'s baked points, and draw lines between them using [method _fill_gap].
|
||||||
|
|
Loading…
Reference in a new issue