Correct bug with 2nd loaded image in item creator showing at the wrong size

This commit is contained in:
Balloonpopper
2022-09-13 22:30:38 +10:00
committed by Julian Murgia
parent f74cb48b3d
commit c660e2d51c
2 changed files with 5 additions and 4 deletions

View File

@@ -31,10 +31,14 @@ var image_size:Vector2
var main_menu_requested:bool
var inventory_mode:bool
var settings_modified:bool
var preview_size:Vector2
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
# Capture the size of the window before we update its contents so we have
# the absolute size before it gets scaled contents applied to it
preview_size = get_node(PREVIEW_NODE).rect_size
inventory_mode = false
item_creator_reset()
@@ -81,8 +85,6 @@ func item_creator_reset() -> void:
func resize_image() -> void:
var preview_size = get_node(PREVIEW_NODE).rect_size
# Calculate the scale to make the preview as big as possible in the preview window depending on
# the height to width ratio of the frame
image_size = image_stream_texture.get_size()
@@ -95,7 +97,6 @@ func resize_image() -> void:
else:
get_node(PREVIEW_NODE).rect_scale = Vector2(preview_scale.y, preview_scale.y)
func background_on_ItemName_text_changed(new_text: String) -> void:
get_node(GLOBAL_ID_NODE).text = new_text
settings_modified = true

View File

@@ -745,7 +745,7 @@ search_in_file_extensions=PoolStringArray( "gd", "shader", "esc" )
[editor_plugins]
enabled=PoolStringArray( "res://addons/escoria-core/plugin.cfg", "res://addons/escoria-dialog-simple/plugin.cfg", "res://addons/escoria-ui-9verbs/plugin.cfg" )
enabled=PoolStringArray( "res://addons/escoria-core/plugin.cfg", "res://addons/escoria-dialog-simple/plugin.cfg", "res://addons/escoria-ui-9verbs/plugin.cfg", "res://addons/escoria-wizard/plugin.cfg", "res://addons/godot-plugin-refresher/plugin.cfg" )
[escoria]