Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2873] Android: Rotate + Scale animations need to support relative anchorPoints

GitHub Issuen/a
TypeNew Feature
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:19.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M07
ComponentsAndroid
Labelsandroid, animation, feature, release-1.6.0, reported-1.6.0
ReporterMarshall Culpepper
AssigneeMarshall Culpepper
Created2011-04-15T03:31:42.000+0000
Updated2011-04-17T02:00:19.000+0000

Description

The new Matrix based animations only support absolute positions in anchorPoint, not 0-1 like our current API dictates. This will require us to save us a Matrix array internally so we can correctly apply the rotate() operation with the calculated width/height of the child.

Comments

  1. Marshall Culpepper 2011-04-15

    (from [15e1a2e25a563b55ff15f42c0f6b4e5e88fb1671]) Ti2DMatrix now saves it's state in a linked list so all operations can be applied in order and relative to widget height/width. scale and
    rotate also now accept "from" arguments to allow for more fine-grained
    control of each matrix operation [#2873 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/15e1a2e25a563b55ff15f42c0f6b4e5e88fb1671"> https://github.com/appcelerator/titanium_mobile/commit/15e1a2e25a56...

  2. Marshall Culpepper 2011-04-15

    Here's the code I used to test this bug:

       
       var view = Ti.UI.createLabel({
           backgroundColor: 'blue',
           center: {
               x: '50%',
               y: '50%'
           },
           color: 'white',
           text: 'Animate me',
           width: 120, height: 100
       });
       
       var inout = true;
       win.add(view);
       
       var inTransform = Ti.UI.create2DMatrix().rotate(0, 180).scale(1.0, 1.0, 2.0, 2.0);
       var outTransform = Ti.UI.create2DMatrix().rotate(180, 0).scale(2.0, 2.0, 1.0, 1.0);
       
       view.addEventListener("click", function(e) {
           view.animate({ transform: inout ? inTransform : outTransform, duration: 800, anchorPoint: { x: 0.5, y: 0.5 }});
           inout = !inout;
       });
       
  3. Marshall Culpepper 2011-04-15

    (from [5b58229a4a9ebaf4f37a9e7e9264f94005d0a39c]) fix for iterating back in the matrix linked list, don't even try to interpolate frames when the user supplies a transform. this makes
    constant transform application much smoother [#2841] [#2873]
    https://github.com/appcelerator/titanium_mobile/commit/5b58229a4a9ebaf4f37a9e7e9264f94005d0a39c"> https://github.com/appcelerator/titanium_mobile/commit/5b58229a4a9e...

  4. Opie Cyrus 2011-04-15

    verified emulator 2.2

JSON Source