Skip to content

Commit eef9dd0

Browse files
used 2 argument form for rotate() on Android, closes #11
1 parent aa26084 commit eef9dd0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Resources/path.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,17 @@ var createMenuButton = function() {
220220
animations.open.addEventListener('complete', function() {
221221
isAnimating = false;
222222
});
223-
animations.close.transform = Ti.UI.create2DMatrix().rotate(0);
223+
224+
// In Titanium, Android rotations always start at zero, regardless of last position.
225+
// In Android Titanium apps you can pass two arguments to the rotate() function,
226+
// the first being the starting rotation, the second being the final rotation.
227+
// This is not a cross-platform method, so you need to make sure you are on Android
228+
// before using 2 arguments.
229+
if (isAndroid) {
230+
animations.close.transform = Ti.UI.create2DMatrix().rotate(45, 0);
231+
} else {
232+
animations.close.transform = Ti.UI.create2DMatrix().rotate(0);
233+
}
224234
animations.close.addEventListener('complete', function() {
225235
isAnimating = false;
226236
});

0 commit comments

Comments
 (0)