Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13488] Android: Border of a view does not rotate with matrix transform, works on iOS

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.0.2, Release 3.1.0
Fix Version/sn/a
Componentsn/a
Labelsparity
ReporterDaniel Sefton
AssigneeUnknown
Created2013-04-08T23:41:03.000+0000
Updated2018-02-28T20:03:32.000+0000

Description

*Problem description* When a view has a border and is rotated with matrix transforms, only the fill of the view is rotated - the border remains stationary. This is a parity issue since it works fine on iOS. *Steps to reproduce* 1. Run test case. 2. Tap rotate a number of times. 3. Observe that only the fill colour rotates, the border remains stationary. *Test case*
var win = Ti.UI.createWindow({
	backgroundColor : "#FFF"
});

var viewToRotate = Ti.UI.createView();

var selectionCircle = Ti.UI.createView({
	backgroundColor : 'yellow',
	opacity : 0.6,
	borderWidth : 3,
	borderColor : "black",
	borderRadius : 25,
	top : 250,
	left : 250,
	height : 300,
	width : 50,
});

viewToRotate.add(selectionCircle);

var rotateButton = Ti.UI.createButton({
	bottom : 10,
	width : 100,
	title : 'Rotate'
});

var selectionRotation = 0;

rotateButton.addEventListener('click', function(e) {
	selectionRotation = selectionRotation + 45;
	var rotateSelection = Ti.UI.create2DMatrix({
		rotate : (selectionRotation)
	});
	selectionCircle.transform = rotateSelection;
});

viewToRotate.add(rotateButton);

win.add(viewToRotate);
win.open();

Comments

  1. Daniel Sefton 2013-04-08

    Tested and confirmed on Samsung Galaxy S2 Android 2.3.6 with Ti SDK 3.0.2 GA and latest 3.1 CI.
  2. Manuel Conde Vendrell 2014-04-09

    Also happens with Ti 3.2.1GA on Sony MT27 with Android 4.0.3 (and on emulator). In my case I was trying to translate a borderRadius=5 label. If I set borderRadius, translation moves the content, but not the border. To solve it I include the label in a view and translate the view instead.
  3. Juan Manuel Haedo 2014-05-11

    Still having the same problem on version 3.2.3

JSON Source