Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds an improvement to layout animation. When updating layout bounds (for example when a parent layout resizes), we were initially setting elapsedSeconds to 0. This restarts the animation, however in cases when the layout bounds is constantly updating (see attached videos), the animation would never progress until the layout bounds stopped updating. An alternative was to not reset elapsedSeconds which was also tested, but in that case the result was odd visual issues like snapping to the new layout bounds (in cases where elapsedSeconds was close to the animation duration). An interim solution (until we find a better one) is to only reset elapsedSeconds to 0 if it is greater than some arbitrary time, thus the animation will continue to progress relatively smoothly. Here are the scenarios. This PR implements the 3rd option. **Always set elapsedSeconds to 0 when updating layout bounds** https://github.com/user-attachments/assets/d430edba-37f4-408d-843f-9f67abfb101d **Never set elapsedSeconds to 0 when updating layout bounds** https://github.com/user-attachments/assets/a8abae5b-647a-437e-9c0f-09d681d6716e **Set elapsedSeconds to 0 after some time has elapsed** https://github.com/user-attachments/assets/3d63cb14-2977-4ea5-b38d-3fcca1f1a666 Diffs= 4732c37b5 Improve layout animation (#7712) Co-authored-by: Philip Chung <philterdesign@gmail.com>
- Loading branch information