Ship from Inventory

Ship from Inventory

13.5k Downloads

Scale calculating bug in Portraiture

NiszaCrizane opened this issue ยท 0 comments

commented

Hi,
I found a little bug in Portraiture [ TextureLoader.loadAllPortraits() ]
The scale gets calculated as an int, so my Texture (288px width => 144px Tile) gets a scale of 2 instad of 2.25f.

I tried casting tileWith to float and used 64.0f for the devision, but that also didn't work (not sure why...).
I had to cast everything to/use double bofore the division and back to float after.

So, this worked fine:
double tileWith = Convert.ToDouble(Math.Max(texture.Width / 2, 64));
float scale = (float) (tileWith / 64.0);