Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19592] Anchor point not preserved after rotation in 2DMatrix Android

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionDuplicate
Resolution Date2018-04-19T14:36:39.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterJoseba Alonso
AssigneeUnknown
Created2014-11-08T09:24:17.000+0000
Updated2018-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;

Comments

  1. Yordan Banev 2018-04-19

    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.

JSON Source