{ "id": "172618", "key": "TIMOB-26563", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-12-03T13:53:31.000+0000", "created": "2018-11-15T02:40:46.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "2dmatrix", "android", "animation", "breaking-change", "ios", "parity", "scale", "unit" ], "versions": [], "issuelinks": [ { "id": "57001", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "171242", "key": "TIMOB-25839", "fields": { "summary": "TiAPI: Touch event coordinate units do not match between platforms", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-12-03T14:02:49.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "*Summary:*\r\nThe {{2DMatrix.translate()}} method's (x,y) values are handled inconsistently between platforms.\r\n\r\nOn Android, the units are expected to be pixels (aka: \"px\").\r\nOn iOS, the units are expected to be dips (aka: \"dp\").\r\n\r\nThe {{translate()}} method should be changed to use the units assigned to the \"tiapp.xml\" file's \"ti.ui.defaultunit\" property. This way they would be handled consistently between platforms and the units which match the coordinates used by the window's views (makes the math easier to calculate).\r\n\r\n*Steps to reproduce:*\r\nFor this animation test, a blue square is supposed to move from the top-left corner to the bottom-right corner.\r\n# Set \"tiapp.xml\" property \"ti.ui.defaultunit\" to \"dp\".\r\n# Build and run on iOS.\r\n# Notice that the blue square correctly animated to bottom-right corner. (This is good.)\r\n# Set \"tiapp.xml\" property \"ti.ui.defaultunit\" to \"px\".\r\n# Build and run on iOS.\r\n# Notice that the blue square moves off screen, past the bottom-right corner. (This is the bug.)\r\n# Build and run on Android.\r\n# Notice that the blue square correctly animated to bottom-right corner. (This is good.)\r\n# Set \"tiapp.xml\" property \"ti.ui.defaultunit\" to \"dp\".\r\n# Build and run on Android.\r\n# Notice that the blue square does not reach the bottom-right corner. (This is the bug.)\r\n\r\n{code:javascript}\r\nvar SQUARE_SIZE = 80;\r\nvar window = Ti.UI.createWindow({\r\n\tbackgroundColor: \"white\",\r\n\tfullscreen: true,\r\n});\r\nvar squareView = Ti.UI.createView({\r\n\tbackgroundColor: \"blue\",\r\n\tleft: 0,\r\n\ttop: 0,\r\n\twidth: SQUARE_SIZE,\r\n\theight: SQUARE_SIZE,\r\n});\r\nwindow.add(squareView);\r\nwindow.addEventListener(\"postlayout\", function() {\r\n\tif (!squareView.wasAnimated) {\r\n\t\tvar windowSize = window.size;\r\n\t\tvar newX = windowSize.width - SQUARE_SIZE;\r\n\t\tvar newY = windowSize.height - SQUARE_SIZE;\r\n\t\tvar animation = Ti.UI.createAnimation({\r\n\t\t\ttransform: Ti.UI.create2DMatrix().translate(newX, newY),\r\n\t\t\tduration: 2000,\r\n\t\t});\r\n\t\tsquareView.wasAnimated = true;\r\n\t\tsquareView.animate(animation);\r\n\t}\r\n});\r\nwindow.open();\r\n{code}\r\n\r\n*Note:*\r\nThis is not an issue with {{2DMatrix.scale()}} since scaling is a \"relative\" operation. Versus translations works with \"absolute\" coordinates.\r\n", "attachment": [], "flagged": false, "summary": "TiAPI: 2DMatrix translate() coordinate units do not match between platforms", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "443625", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10472", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-15T05:58:31.000+0000", "updated": "2018-11-15T05:58:31.000+0000" }, { "id": "444046", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*FR Passed.* Awaiting for CR.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-29T13:35:26.000+0000", "updated": "2018-11-29T13:35:26.000+0000" }, { "id": "444159", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Verified fix in SDK Version {{8.0.0.v20181130132038}}.\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/10472", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-12-03T14:02:40.000+0000", "updated": "2018-12-03T14:02:40.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }