New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-24793] Android: Fix Ti.UI.View.center calculation #9125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The center point is supposed to be relative to the top-left corner of the parent view. We document it here.
This new code breaks this behavior and makes the center point relative to center of the parent view. This is not correct. Nor does it match iOS (I tested it).
Also, I do see an old bug here (before your change) where a center point of (0,0) is wrongly ignored. (0,0) should position the view in the top-left corner of the parent, which I've confirmed is how it works on iOS.
Thanks for pointing that out, I assumed center of parent due to not having to calculate for zero. Updated PR |
No worries! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: Pass
FR Passed. Used the code below to test:
Center is the right center now & is calculated properly. Studio Ver: 4.9.0.201705302345 |
Ti.UI.View.center
property when{x: 0, y: 0}
is usedTEST CASE
JIRA Ticket