{"action":"created","issue":{"url":"https://api.github.com/repos/mikefogg/SquareCamera/issues/29","repository_url":"https://api.github.com/repos/mikefogg/SquareCamera","labels_url":"https://api.github.com/repos/mikefogg/SquareCamera/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/mikefogg/SquareCamera/issues/29/comments","events_url":"https://api.github.com/repos/mikefogg/SquareCamera/issues/29/events","html_url":"https://github.com/mikefogg/SquareCamera/issues/29","id":115476241,"number":29,"title":"How to use it in a landscape app?","user":{"login":"m1ga","id":4334997,"avatar_url":"https://avatars.githubusercontent.com/u/4334997?v=3","gravatar_id":"","url":"https://api.github.com/users/m1ga","html_url":"https://github.com/m1ga","followers_url":"https://api.github.com/users/m1ga/followers","following_url":"https://api.github.com/users/m1ga/following{/other_user}","gists_url":"https://api.github.com/users/m1ga/gists{/gist_id}","starred_url":"https://api.github.com/users/m1ga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1ga/subscriptions","organizations_url":"https://api.github.com/users/m1ga/orgs","repos_url":"https://api.github.com/users/m1ga/repos","events_url":"https://api.github.com/users/m1ga/events{/privacy}","received_events_url":"https://api.github.com/users/m1ga/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-11-06T10:14:44Z","updated_at":"2016-07-25T14:56:32Z","closed_at":null,"body":"I have an iPad app with orientationMode to landscape. When I click the scan button I open a new window like this:\r\n\r\n```\r\nvar SquareCamera = require('com.mfogg.squarecamera'); // Initialize the SquareCamera module\r\n\r\n        qrCodeWindow = Titanium.UI.createWindow({\r\n            navBarHidden: true,\r\n            exitOnClose: false,\r\n            backgroundColor: 'black',\r\n            width: '100%',\r\n            height: '100%',\r\n            fullscreen: true,\r\n            orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]\r\n        });\r\n\r\n        var cameraTransform = Ti.UI.create2DMatrix();\r\n        cameraTransform = cameraTransform.rotate(-90);\r\n\r\n        var camera_view = SquareCamera.createView({\r\n            top: 50,\r\n            left:0,\r\n            right:0,\r\n            bottom:0,\r\n            detectCodes: true, \r\n            backgroundColor: \"#fff\",\r\n            frontQuality: SquareCamera.QUALITY_HIGH, // Optional Defaults to QUALITY_HIGH\r\n            backQuality: SquareCamera.QUALITY_HD, // Optional Defaults to QUALITY_HD\r\n            camera: \"back\", \r\n            transform:cameraTransform\r\n        });\r\n\r\n        camera_view.addEventListener(\"code\", function(e){\r\n           \r\n            qrCodeWindow.close();\r\n           \r\n        });\r\n        var btnClose = $.UI.create(\"Button\", {\r\n            classes: [\"icon\"],\r\n            title: \"\\ue903\",\r\n            top: 10,\r\n            right: 10\r\n        })\r\n        btnClose.addEventListener(\"click\", onClickCloseQR);\r\n        qrCodeWindow.add(btnClose);\r\n        qrCodeWindow.add(camera_view);\r\n        qrCodeWindow.open();\r\n```\r\nBut the camera view is not in the top left corner and when I rotate the ipad the camera is upside down. Do I have to use the transform or is there a way to make the camera view rotate to the window orientation? "},"comment":{"url":"https://api.github.com/repos/mikefogg/SquareCamera/issues/comments/234977919","html_url":"https://github.com/mikefogg/SquareCamera/issues/29#issuecomment-234977919","issue_url":"https://api.github.com/repos/mikefogg/SquareCamera/issues/29","id":234977919,"user":{"login":"mikefogg","id":4834250,"avatar_url":"https://avatars.githubusercontent.com/u/4834250?v=3","gravatar_id":"","url":"https://api.github.com/users/mikefogg","html_url":"https://github.com/mikefogg","followers_url":"https://api.github.com/users/mikefogg/followers","following_url":"https://api.github.com/users/mikefogg/following{/other_user}","gists_url":"https://api.github.com/users/mikefogg/gists{/gist_id}","starred_url":"https://api.github.com/users/mikefogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikefogg/subscriptions","organizations_url":"https://api.github.com/users/mikefogg/orgs","repos_url":"https://api.github.com/users/mikefogg/repos","events_url":"https://api.github.com/users/mikefogg/events{/privacy}","received_events_url":"https://api.github.com/users/mikefogg/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T14:56:32Z","updated_at":"2016-07-25T14:56:32Z","body":"@m1ga little delayed here but thanks for the addition!"}}
{"actor":{"display_login":"mikefogg"}}