[TIMOB-13488] Android: Border of a view does not rotate with matrix transform, works on iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.0.2, Release 3.1.0 |
Fix Version/s | n/a |
Components | n/a |
Labels | parity |
Reporter | Daniel Sefton |
Assignee | Unknown |
Created | 2013-04-08T23:41:03.000+0000 |
Updated | 2018-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();
Tested and confirmed on Samsung Galaxy S2 Android 2.3.6 with Ti SDK 3.0.2 GA and latest 3.1 CI.
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.
Still having the same problem on version 3.2.3