Author Topic: Using overflow ellipsis with 'resize freely' + 'max width'  (Read 6343 times)

Wisteso

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 3
  • Posts: 103
    • View Profile
Using overflow ellipsis with 'resize freely' + 'max width'
« on: December 22, 2016, 01:11:09 PM »
I am using a UITable to center a combination of UISprite + UILabel within a 180 width region. This means that I cannot use 'clamp' content since it won't change the bounds of the text, making the content centering behavior of UITable not possible.

I do also want the ellipses for when the text hits the limits of the space (which I set using MaxWidth of 144), so I looked at UILabel and saw that at line 1337, there is the following code...

  1. bool fits = NGUIText.WrapText(printedText, out mProcessedText, true, false,
  2.         mOverflowEllipsis && mOverflow == Overflow.ClampContent);

which I changed to...

  1. bool fits = NGUIText.WrapText(printedText, out mProcessedText, true, false,
  2.         mOverflowEllipsis);

and it appears to be working perfectly (aside from the fact that I cant toggle the ellipses easily in the inspector). Does this seem like a fairly safe change?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Using overflow ellipsis with 'resize freely' + 'max width'
« Reply #1 on: December 24, 2016, 11:21:12 PM »
Seems fine to me.