Author Topic: UISprite minHeight does not take pixelSize into account  (Read 3613 times)

Cabal

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 16
    • View Profile
UISprite minHeight does not take pixelSize into account
« on: June 24, 2015, 12:06:42 PM »
Hi,

We ran into an issue with SD/HD/UD texture sets and setting a 9-slice sprite to its minimum size.

We tracked it down to the minHeight function in UISprite.cs.
Unlike minWidth, which works correctly, the minHeight function does not apply the pixel size to the padding.

To fix it locally, we changed the function to match what minWidth does:
(around line 188)
float ps = pixelSize;
...
if (sp != null) min += Mathf.RoundToInt(ps * (sp.paddingTop + sp.paddingBottom));

Stephane

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISprite minHeight does not take pixelSize into account
« Reply #1 on: June 25, 2015, 08:56:02 PM »
Thanks!