mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-21 21:13:14 +00:00
Don't create guides if they have less than 2 points
This commit is contained in:
parent
5814123ee8
commit
9617d18bc8
2 changed files with 6 additions and 0 deletions
|
@ -66,6 +66,9 @@ func _on_HorizontalRuler_pressed() -> void:
|
||||||
guide.type = guide.Types.HORIZONTAL
|
guide.type = guide.Types.HORIZONTAL
|
||||||
guide.add_point(Vector2(-19999, Global.canvas.current_pixel.y))
|
guide.add_point(Vector2(-19999, Global.canvas.current_pixel.y))
|
||||||
guide.add_point(Vector2(19999, Global.canvas.current_pixel.y))
|
guide.add_point(Vector2(19999, Global.canvas.current_pixel.y))
|
||||||
|
if guide.points.size() < 2:
|
||||||
|
guide.queue_free()
|
||||||
|
return
|
||||||
Global.canvas.add_child(guide)
|
Global.canvas.add_child(guide)
|
||||||
Global.has_focus = false
|
Global.has_focus = false
|
||||||
update()
|
update()
|
||||||
|
|
|
@ -66,6 +66,9 @@ func _on_VerticalRuler_pressed() -> void:
|
||||||
guide.type = guide.Types.VERTICAL
|
guide.type = guide.Types.VERTICAL
|
||||||
guide.add_point(Vector2(Global.canvas.current_pixel.x, -19999))
|
guide.add_point(Vector2(Global.canvas.current_pixel.x, -19999))
|
||||||
guide.add_point(Vector2(Global.canvas.current_pixel.x, 19999))
|
guide.add_point(Vector2(Global.canvas.current_pixel.x, 19999))
|
||||||
|
if guide.points.size() < 2:
|
||||||
|
guide.queue_free()
|
||||||
|
return
|
||||||
Global.canvas.add_child(guide)
|
Global.canvas.add_child(guide)
|
||||||
Global.has_focus = false
|
Global.has_focus = false
|
||||||
update()
|
update()
|
||||||
|
|
Loading…
Add table
Reference in a new issue