Author Topic: UIWidget.PanelCompareFunc issue?  (Read 4500 times)

beings

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 5
    • View Profile
UIWidget.PanelCompareFunc issue?
« on: August 03, 2015, 05:07:02 AM »
I think that the sort function has something wrong.


      if (leftMat != null) return -1;
      if (rightMat != null) return 1;

===>

      if (leftMat != null && rightMat == null) return -1;
      if (leftMat == null && rightMat != null) return 1;


or ===>

      if (rightMat == null) return -1;
      if (leftMat == null) return 1;
« Last Edit: August 03, 2015, 06:07:40 AM by beings »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIWidget.PanelCompareFunc issue?
« Reply #1 on: August 05, 2015, 08:48:34 AM »
I'd say if anything, it should be
  1.                 if (leftMat == null) return 1;
  2.                 if (rightMat == null) return -1;

beings

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 5
    • View Profile
Re: UIWidget.PanelCompareFunc issue?
« Reply #2 on: August 17, 2015, 04:27:24 AM »
And then?
I'd say if anything, it should be
  1.                 if (leftMat == null) return 1;
  2.                 if (rightMat == null) return -1;