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

If imported image size is less than 100px, limit the max value of the spritesheet frames

This commit is contained in:
OverloadedOrama 2020-06-17 03:34:24 +03:00
parent 28818171d4
commit 063ea04b4c

View file

@ -13,6 +13,11 @@ onready var texture_rect : TextureRect = $VBoxContainer/CenterContainer/TextureR
onready var spritesheet_options = $VBoxContainer/HBoxContainer/SpritesheetOptions
func _ready() -> void:
spritesheet_options.get_node("HorizontalFrames").max_value = min(spritesheet_options.get_node("HorizontalFrames").max_value, image.get_size().x)
spritesheet_options.get_node("VerticalFrames").max_value = min(spritesheet_options.get_node("VerticalFrames").max_value, image.get_size().y)
func _on_PreviewDialog_about_to_show() -> void:
var img_texture := ImageTexture.new()
img_texture.create_from_image(image)