Author Topic: Teensy bug in UIGrid with Smooth Tween  (Read 114 times)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 32
  • -Receive: 140
  • Posts: 1,762
    • View Profile
Teensy bug in UIGrid with Smooth Tween
« on: May 17, 2017, 07:43:02 AM »
If you have say 9 elements in your grid, and you set the pivot to center (non-TopLeft) and use the Smooth Tween option on the grid, the first element will be put instantly in the Top Left corner.

It looks to be that it measures whether a SpringPosition should be used, before it applies the origin offset.

The quick and dirty fix is to remove the SqrMagnitude check in UIGrid.cs:371 which means the center element will tween from 0,0,0 to 0,0,0, so not a terrible loss.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 277
  • -Receive: 1133
  • Posts: 21,893
  • Toronto, Canada
    • View Profile
Re: Teensy bug in UIGrid with Smooth Tween
« Reply #1 on: May 19, 2017, 05:10:45 AM »
Hey Nicki! It's line 380 here. Would this work then?
  1. if (animateSmoothly && Application.isPlaying && (pivot != UIWidget.Pivot.TopLeft || Vector3.SqrMagnitude(t.localPosition - pos) >= 0.0001f))
« Last Edit: May 19, 2017, 05:15:52 AM by ArenMook »