Author Topic: Wrong scaling of font icons with Atlas.pixelSize != 1  (Read 5358 times)

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Wrong scaling of font icons with Atlas.pixelSize != 1
« on: January 02, 2014, 05:15:01 AM »
Font icons aren't scaled correctly when using atlases that have a pixel size unequal 1.

Version: 3.0.8f3

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: Wrong scaling of font icons with Atlas.pixelSize != 1
« Reply #1 on: January 02, 2014, 06:02:32 AM »
Changing NGUIText line 933 did the job for me so far.

  1. float v0x = x + symbol.offsetX * pixelSize;
  2. float v1x = v0x + symbol.width * pixelSize;
  3. float v1y = -(y + symbol.offsetY * pixelSize);
  4. float v0y = v1y - symbol.height * pixelSize;
  5.  
  6. verts.Add(new Vector3(v0x, v0y));
  7. verts.Add(new Vector3(v0x, v1y));
  8. verts.Add(new Vector3(v1x, v1y));
  9. verts.Add(new Vector3(v1x, v0y));
  10.  
  11. x += finalSpacingX + symbol.advance * pixelSize;
  12.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Wrong scaling of font icons with Atlas.pixelSize != 1
« Reply #2 on: January 02, 2014, 11:32:53 AM »
Thanks, I will add it to the list.