1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Fixed bucket crash when there were no patterns

This commit is contained in:
OverloadedOrama 2020-07-09 15:52:59 +03:00
parent 4a668f71f5
commit 671536cbd7
2 changed files with 11 additions and 5 deletions

View file

@ -48,6 +48,8 @@ func _on_PatternOffsetY_value_changed(value : float):
func get_config() -> Dictionary:
if !_pattern:
return {}
return {
"pattern_index" : _pattern.index,
"fill_area" : _fill_area,
@ -58,6 +60,7 @@ func get_config() -> Dictionary:
func set_config(config : Dictionary) -> void:
if _pattern:
var index = config.get("pattern_index", _pattern.index)
_pattern = Global.patterns_popup.get_pattern(index)
_fill_area = config.get("fill_area", _fill_area)
@ -78,6 +81,9 @@ func update_config() -> void:
func update_pattern() -> void:
if _pattern == null:
if Global.patterns_popup.default_pattern == null:
return
else:
_pattern = Global.patterns_popup.default_pattern
var tex := ImageTexture.new()
tex.create_from_image(_pattern.image, 0)