This commit is contained in:
Marco 2020-01-10 20:32:31 +01:00
parent 7b0251fdfa
commit 5e49c3eae8
2 changed files with 6 additions and 2 deletions

View file

@ -32,8 +32,10 @@ func _ready() -> void:
# The sprite itself
if layers.empty():
var sprite := Image.new()
if Global.config_cache.has_section_key("preferences", "default_width") && Global.config_cache.has_section_key("preferences", "default_height"):
size = Vector2(Global.config_cache.get_value("preferences", "default_width"), Global.config_cache.get_value("preferences", "default_height"))
if Global.is_default_image:
if Global.config_cache.has_section_key("preferences", "default_width") && Global.config_cache.has_section_key("preferences", "default_height"):
size = Vector2(Global.config_cache.get_value("preferences", "default_width"), Global.config_cache.get_value("preferences", "default_height"))
Global.is_default_image = !Global.is_default_image
sprite.create(size.x, size.y, false, Image.FORMAT_RGBA8)
sprite.lock()

View file

@ -24,6 +24,8 @@ var image_clipboard : Image
# warning-ignore:unused_class_variable
var theme_type := "Dark"
# warning-ignore:unused_class_variable
var is_default_image := true
# warning-ignore:unused_class_variable
var default_image_width := 32
# warning-ignore:unused_class_variable
var default_image_height := 32