[TIMOB-19592] Anchor point not preserved after rotation in 2DMatrix Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2018-04-19T14:36:39.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Joseba Alonso |
Assignee | Unknown |
Created | 2014-11-08T09:24:17.000+0000 |
Updated | 2018-04-19T14:36:39.000+0000 |
Description
If you create a matrix with an anchor point and then use the rotate() method, the resulting matrix will be set with the default anchor point and no way to change it.
You will expect this view to be rotated from the bottom, but it is from the center.
var v = Ti.UI.createView({
width:100,
height:200,
backgroundColor:"red"
});
$.index.add(v);
var matrix = Ti.UI.create2DMatrix({
anchorPoint: {x:0.5,y:1}
});
matrix = matrix.rotate(45);
v.transform = matrix;
Clarification: According to the docs: https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Animation-property-anchorPoint
anchorPoint
is a property of Ti.UI.Animation not Ti.UI.2DMatrix. The code snippet needs to be adjusted according to that in order to test it properly. Doing so and running the sample against an SDK built with the changes from TIMOB-16596 results in a proper behavior. Closing the ticket.