Godot version
Godot 3 alpha 2
Issue description:
TextureRect doesn't scale below image size in scale stretch mode. The only way to scale it is to directly use the scale property and edit the values.
Proposal
Let the texture frame go below the image size and have different handles for margin change and scale change.
This is not a bug, it's working as intended. If you want to make it shrink less than it's size then toggle the "expand" property. Otherwise, this would be unusable in containers.
cvool
Here is some code to resize an image texture up/down in size:
func get_resized_texture(t: Texture, width: int = 0, height: int = 0):
var image = t.get_data()
if width > 0 && height > 0:
image.resize(width, height)
var itex = ImageTexture.new()
itex.create_from_image(image)
return itex
Most helpful comment
This is not a bug, it's working as intended. If you want to make it shrink less than it's size then toggle the "expand" property. Otherwise, this would be unusable in containers.