Game Development Community

Scaling a bitmap down

by Trent · in Torque X 3D · 01/12/2010 (7:43 pm) · 3 replies

In my gui I can scale bitmaps up in size, but not down. Why is this?

#1
01/12/2010 (11:35 pm)
Interesting, I wasn't aware of this. I'll have to give a try and find out why. There's no specific design reason, maybe somewhere the code is only scaling if the scale factor > 1.

John K.
#2
01/13/2010 (1:58 am)
I had actually penciled in looking into that as well, but I thought I'd ask if there was a design reason for it first.
#3
01/13/2010 (9:27 am)
I think the culprit is in GuiControl line 575 in the method [public virtual void SetBounds(Vector2 position, Vector2 extent)]:

Vector2 actualExtent = new Vector2(MathHelper.Max(_minExtent.X, extent.X), MathHelper.Max(_minExtent.Y, extent.Y));

_minExtent seems to be the actual size of the bitmap.