Author Topic: UILabel small bug in Editor Play mode  (Read 2687 times)

LightStorm

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 17
    • View Profile
UILabel small bug in Editor Play mode
« on: May 26, 2014, 04:12:03 AM »
Hi.
There is a small bug in UILabel in NGUI v3.6.1.
I'm trying to change content of label while it's disabled and then get Height of it. Inside Editor Play mode label returns wrong (old) sizes. But builded app works ok.
I think this should be fixed by adding Application.isPlaying check in ProcessAndRequest method in UILabel.cs, so label will be updated in Editor Play mode even if disabled. Thanks!
  1.         void ProcessAndRequest ()
  2.         {
  3. #if UNITY_EDITOR
  4.                 if (!Application.isPlaying && !NGUITools.GetActive(this)) return;
  5.                 if (!mAllowProcessing) return;
  6. #endif
  7.                 if (ambigiousFont != null) ProcessText();
  8.         }
  9.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel small bug in Editor Play mode
« Reply #1 on: May 26, 2014, 10:57:00 PM »
Ideally if you are trying to get the printed size of something you should use NGUIText.CalculatePrintedSize directly. Disabled labels don't really need to request the text to be processed. That said, I don't foresee any negative side effects of your change. I'll add it and see if I notice anything.