Support => NGUI 3 Support => Topic started by: Wisteso on June 06, 2016, 07:50:52 PM
Title: UI2D Sprite not considering Pixel Size when doing Snap / MakePixelPerfect
Post by: Wisteso on June 06, 2016, 07:50:52 PM
Using version 3.8 (didnt see any patch notes about changing/fixing this since then)
With the old UI Sprite, using Unity Atlases, the "pixel size" is factored in when doing Snap/MakePixelPerfect. If set to 0.5, the sprite size will be half of the raster's size.
With the new UI2D Sprite, the pixel size seems to have no impact on Snap/MakePixelPerfect. Am I missing something?
Title: Re: UI2D Sprite not considering Pixel Size when doing Snap / MakePixelPerfect
Post by: ArenMook on June 06, 2016, 10:18:53 PM
That's probaby a minor bug. You can try fixing it by modifying UI2DSprite's MakePixelPerfect function from:
int w = Mathf.RoundToInt(rect.width);
int h = Mathf.RoundToInt(rect.height);
to:
int w = Mathf.RoundToInt(pixelSize * rect.width);
int h = Mathf.RoundToInt(pixelSize * rect.height);