Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18049] Andriod and Mobile Web: Rotation issues in 2DMatrix

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionWon't Fix
Resolution Date2017-06-29T18:42:09.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, MobileWeb
Labels2DMatrix, Android, MobileWeb, Rotation
ReporterJoseba Alonso
AssigneeEric Merriman
Created2014-11-08T09:14:30.000+0000
Updated2017-08-16T01:10:21.000+0000

Description

Hi, It appears you cant rotate a matrix that you configure with rotation. This gives you a runtime error:
var matrix = Ti.UI.create2DMatrix({ 
	rotate: 45
});
matrix.rotate(45);
Message: Uncaught TypeError: Property 'rotate' of object #<2DMatrix> is not a function

Comments

  1. Shuo Liang 2014-11-18

    Problem can be reproduced on Android and Mobile Web. Work well on IOS. Here is sample test case:
       var win = Ti.UI.createWindow({
         backgroundColor: 'white'
       });
       
       var label = Ti.UI.createLabel({
         font:{fontSize:50},
         text:'Titanium',
         textAlign:'center',
         top: 100
       });
       win.add(label);
       
       var button = Ti.UI.createButton({
         title:'Animate',
         bottom:20,
         width:200, height:40
       });
       win.add(button);
       
       button.addEventListener('click', function(){
         var t1 = Ti.UI.create2DMatrix({
         	rotate:15
         });
         
         t1 = t1.rotate(30);
         t1 = t1.translate(0, 300);
         var a1 = Ti.UI.createAnimation();
         a1.transform = t1;
         a1.duration = 800;
         label.animate(a1);
       });
       win.open();
       
  2. Shuo Liang 2014-11-18

    Only work around is do not configure rotate property when you create the matrix.
  3. Lee Morris 2017-06-29

    Resolving ticket as "Won't fix" as MobileWeb has been deprecated.

JSON Source