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:
parent
4a668f71f5
commit
671536cbd7
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue