mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29: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:
|
for guide in guides:
|
||||||
if guide is SymmetryGuide:
|
if guide is SymmetryGuide:
|
||||||
continue
|
continue
|
||||||
|
if !is_instance_valid(guide):
|
||||||
|
continue
|
||||||
var coords = guide.points[0].x
|
var coords = guide.points[0].x
|
||||||
if guide.type == Guide.Types.HORIZONTAL:
|
if guide.type == Guide.Types.HORIZONTAL:
|
||||||
coords = guide.points[0].y
|
coords = guide.points[0].y
|
||||||
|
|
|
@ -63,10 +63,12 @@ func _draw() -> void:
|
||||||
func outside_canvas() -> bool:
|
func outside_canvas() -> bool:
|
||||||
if type == Types.HORIZONTAL:
|
if type == Types.HORIZONTAL:
|
||||||
if points[0].y < 0 || points[0].y > project.size.y:
|
if points[0].y < 0 || points[0].y > project.size.y:
|
||||||
|
project.guides.erase(self)
|
||||||
queue_free()
|
queue_free()
|
||||||
return true
|
return true
|
||||||
else:
|
else:
|
||||||
if points[0].x < 0 || points[0].x > project.size.x:
|
if points[0].x < 0 || points[0].x > project.size.x:
|
||||||
|
project.guides.erase(self)
|
||||||
queue_free()
|
queue_free()
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue