mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-30 23:19:49 +00:00
Don't save erased guides in .pxos
This fixes a crash when saving a pxo with guides that have been removed
This commit is contained in:
parent
8cca37e752
commit
8529e93029
|
@ -204,6 +204,8 @@ func serialize() -> Dictionary:
|
|||
for guide in guides:
|
||||
if guide is SymmetryGuide:
|
||||
continue
|
||||
if !is_instance_valid(guide):
|
||||
continue
|
||||
var coords = guide.points[0].x
|
||||
if guide.type == Guide.Types.HORIZONTAL:
|
||||
coords = guide.points[0].y
|
||||
|
|
|
@ -63,10 +63,12 @@ func _draw() -> void:
|
|||
func outside_canvas() -> bool:
|
||||
if type == Types.HORIZONTAL:
|
||||
if points[0].y < 0 || points[0].y > project.size.y:
|
||||
project.guides.erase(self)
|
||||
queue_free()
|
||||
return true
|
||||
else:
|
||||
if points[0].x < 0 || points[0].x > project.size.x:
|
||||
project.guides.erase(self)
|
||||
queue_free()
|
||||
return true
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue