Author Topic: UITable "Reposition Now" moves the panel and clipping?  (Read 5049 times)

sintua

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 0
  • Posts: 63
    • View Profile
UITable "Reposition Now" moves the panel and clipping?
« on: November 02, 2012, 07:37:38 PM »
This may be a bit hard to explain, as it's a very odd bug.

So I make a panel that contains a "table" gameobject with table attached, and inside that assorted buttons and labels. The panel is at 0,0,0; it has clipping on, centered at 0,0. Everything "lines up" with the sprite box underneath it.
The "Table" game object located at -150,255,0 (since otherwise half the contents will stick out of the panel). the contents all line up perfectly.

Now, if I hit reposition now on the UITable (currently doing this in inspector), it LOOKS like nothing has changed, but actually it does something odd:
It moved the panel to 4.999985,15,0 and sets the "center" in UIPanel's clipping settings to -4.999985,-15. With different paddind in the table, it changes the numbers it shifts to.

The expected behaviour is for the clipping and the panel transform to stay put.
This is a somewhat minor bug, since it *visually* doesn't change things, but if you are setting up panels in specific locations, having transforms that shift to apparently random numbers causes all sorts of problems.

(P.S. Congrats on the hire! I look forward to seeing what you do with Unity UI now that you've got your hands on the source!)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITable "Reposition Now" moves the panel and clipping?
« Reply #1 on: November 03, 2012, 04:56:29 AM »
That's intentional. Reposition function shifts the clipping, usually aligning it so that the content begins at the top left corner of the clipped panel.