Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9493] Android: Animation: Rotating and Scaling a view simultaneously does not work correctly

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-06-18T12:17:25.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-12 Core
ComponentsAndroid
Labelscore, module_animation, qe-and060112, qe-testadded, regression
ReporterSatyam Sekhri
AssigneeBill Dawson
Created2012-06-12T02:27:59.000+0000
Updated2012-07-05T12:05:34.000+0000

Description

Animating a view by both rotating and scaling it does not work correctly. This is a Regression. The behavior does not happen on 2.0.2 Steps To Reproduce: 1. Create an application with Sample Code-1 and run the application 2. Click on the Red View 3. Create an application with Sample Code-2 (which has Scale of 2D-Matrix defined before rotation) and run the application 4. Click on the Red View Actual: After Step 2: The red view animates. The view gets scaled but does not rotate After Step 4: The red view animates. The view gets scaled from a size of 0,0 to the scaled size of original view Expected: The red view show animate with both rotation and scaling Sample Code-1
var win = Ti.UI.createWindow({
	backgroundColor:'green'
});

var box = Ti.UI.createView({
			backgroundColor : 'red',
			height : '150',
			width : '100'
		});

		box.addEventListener('click', function() {
			var matrix = Ti.UI.create2DMatrix()
			matrix = matrix.rotate(90);
			matrix = matrix.scale(2, 2);
			var a = Ti.UI.createAnimation({
				transform : matrix,
				duration : 2000,
				autoreverse : true,
				repeat : 3
			});
			box.animate(a);
		});
		win.add(box);
win.open();
Sample Code-2
var win = Ti.UI.createWindow({
	backgroundColor:'green'
});

var box = Ti.UI.createView({
			backgroundColor : 'red',
			height : '150',
			width : '100'
		});

		box.addEventListener('click', function() {
			var matrix = Ti.UI.create2DMatrix()
			matrix = matrix.scale(2, 2);
                        matrix = matrix.rotate(90);
			
			var a = Ti.UI.createAnimation({
				transform : matrix,
				duration : 2000,
				autoreverse : true,
				repeat : 3
			});
			box.animate(a);
		});
		win.add(box);
win.open();

Attachments

FileDateSize
timob9207big.zip2012-06-18T06:38:03.000+00003128768

Comments

  1. Bill Dawson 2012-06-18

    Testing notes

    Use the attached timob9207big.zip. It contains a test for this item (timob-9493) plus for other items so as to test that I didn't regress them. Each test window contains a label describing the expected behavior. If you run the timob-9493 test on the master branch, you'll see that it doesn't work, as explained by Satyam. If you run it on my fix branch, it should work fine.
  2. Bill Dawson 2012-06-18

    Pull request ready https://github.com/appcelerator/titanium_mobile/pull/2416
  3. Michael Pettiford 2012-06-18

    Closing issue Tested with Ti Studio build 2.1.0.201206172244 Ti Mobile SDK2.1.0.v20120618134156 hash r00905cd0 OSX Lion 10.7.3 iPhone 4S OS 5.1, Nexus S OS 4.0.4 The expected behavior is shown

JSON Source