{"action":"created","issue":{"url":"https://api.github.com/repos/Agamnentzar/ag-psd/issues/3","repository_url":"https://api.github.com/repos/Agamnentzar/ag-psd","labels_url":"https://api.github.com/repos/Agamnentzar/ag-psd/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Agamnentzar/ag-psd/issues/3/comments","events_url":"https://api.github.com/repos/Agamnentzar/ag-psd/issues/3/events","html_url":"https://github.com/Agamnentzar/ag-psd/issues/3","id":383577169,"node_id":"MDU6SXNzdWUzODM1NzcxNjk=","number":3,"title":"Layer left, top, bottom, right, width and height can not be set","user":{"login":"human-a","id":1311814,"node_id":"MDQ6VXNlcjEzMTE4MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1311814?v=4","gravatar_id":"","url":"https://api.github.com/users/human-a","html_url":"https://github.com/human-a","followers_url":"https://api.github.com/users/human-a/followers","following_url":"https://api.github.com/users/human-a/following{/other_user}","gists_url":"https://api.github.com/users/human-a/gists{/gist_id}","starred_url":"https://api.github.com/users/human-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/human-a/subscriptions","organizations_url":"https://api.github.com/users/human-a/orgs","repos_url":"https://api.github.com/users/human-a/repos","events_url":"https://api.github.com/users/human-a/events{/privacy}","received_events_url":"https://api.github.com/users/human-a/received_events","type":"User","site_admin":false},"labels":[{"id":303801102,"node_id":"MDU6TGFiZWwzMDM4MDExMDI=","url":"https://api.github.com/repos/Agamnentzar/ag-psd/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"Agamnentzar","id":572298,"node_id":"MDQ6VXNlcjU3MjI5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/572298?v=4","gravatar_id":"","url":"https://api.github.com/users/Agamnentzar","html_url":"https://github.com/Agamnentzar","followers_url":"https://api.github.com/users/Agamnentzar/followers","following_url":"https://api.github.com/users/Agamnentzar/following{/other_user}","gists_url":"https://api.github.com/users/Agamnentzar/gists{/gist_id}","starred_url":"https://api.github.com/users/Agamnentzar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Agamnentzar/subscriptions","organizations_url":"https://api.github.com/users/Agamnentzar/orgs","repos_url":"https://api.github.com/users/Agamnentzar/repos","events_url":"https://api.github.com/users/Agamnentzar/events{/privacy}","received_events_url":"https://api.github.com/users/Agamnentzar/received_events","type":"User","site_admin":false},"assignees":[{"login":"Agamnentzar","id":572298,"node_id":"MDQ6VXNlcjU3MjI5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/572298?v=4","gravatar_id":"","url":"https://api.github.com/users/Agamnentzar","html_url":"https://github.com/Agamnentzar","followers_url":"https://api.github.com/users/Agamnentzar/followers","following_url":"https://api.github.com/users/Agamnentzar/following{/other_user}","gists_url":"https://api.github.com/users/Agamnentzar/gists{/gist_id}","starred_url":"https://api.github.com/users/Agamnentzar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Agamnentzar/subscriptions","organizations_url":"https://api.github.com/users/Agamnentzar/orgs","repos_url":"https://api.github.com/users/Agamnentzar/repos","events_url":"https://api.github.com/users/Agamnentzar/events{/privacy}","received_events_url":"https://api.github.com/users/Agamnentzar/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-11-22T15:17:21Z","updated_at":"2018-11-27T10:15:49Z","closed_at":null,"author_association":"NONE","body":"Hi\r\n\r\nFirst of all thank you very much for this fantastically useful lib.\r\n\r\nI have one issue with it though. I got everything to work for me in a layered canvas except for positioning my layers.\r\n\r\nI am trying to export my HTML5 canvas (fabricJS) as PSD file and keep all the layers. The problem is that no matter what I set for left, top, bottom, right, width or height, ag-psd is going to modify those numbers, crop the layers etc.\r\n\r\nThe only numbers that work are ```left: 0, top: 0, right: canvas.width, bottom: canvas.height``` but these are not the positions I want.\r\nEven if I hard code top, left etc. then I use ```writePsd(psdObject)``` it mutates my PSD object and changes the layer positioning. I did dig into the source code, but could not find out why it changes those numbers.\r\n\r\nAny help is more than helpful."},"comment":{"url":"https://api.github.com/repos/Agamnentzar/ag-psd/issues/comments/442003771","html_url":"https://github.com/Agamnentzar/ag-psd/issues/3#issuecomment-442003771","issue_url":"https://api.github.com/repos/Agamnentzar/ag-psd/issues/3","id":442003771,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjAwMzc3MQ==","user":{"login":"human-a","id":1311814,"node_id":"MDQ6VXNlcjEzMTE4MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1311814?v=4","gravatar_id":"","url":"https://api.github.com/users/human-a","html_url":"https://github.com/human-a","followers_url":"https://api.github.com/users/human-a/followers","following_url":"https://api.github.com/users/human-a/following{/other_user}","gists_url":"https://api.github.com/users/human-a/gists{/gist_id}","starred_url":"https://api.github.com/users/human-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/human-a/subscriptions","organizations_url":"https://api.github.com/users/human-a/orgs","repos_url":"https://api.github.com/users/human-a/repos","events_url":"https://api.github.com/users/human-a/events{/privacy}","received_events_url":"https://api.github.com/users/human-a/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T10:15:49Z","updated_at":"2018-11-27T10:15:49Z","author_association":"NONE","body":"**It worked** this time and I could manage to generate the @2x retina version as well.\r\n\r\nThere are two things still in the ```helpers.js``` file that I think might cause troubles for some:\r\n\r\nlines 117 and 118 are re-assigning right and bottom, would it better to write them as so?:\r\n\r\n```javascript\r\nif (typeof layer.right === 'undefined') {\r\n    layer.right = layer.left + layerWidth;\r\n}\r\nif (typeof layer.bottom === 'undefined') {\r\n    layer.bottom = layer.top + layerHeight;\r\n}\r\n```\r\n\r\nAlso, line 105 and 106 are being done after you check for existence of canvas on line 103, so it would be a safer bet to change lines 105-106 to the following:\r\n\r\n```javascript\r\nvar layerWidth =canvas.width;\r\nvar layerHeight = canvas.height;\r\n```\r\n\r\nOr maybe there is something missing in the logic behind your code.\r\n\r\n-----------------------------------\r\nAs of you you question on \"expected behavior if the bottom & right does not fit the canvas size\" I think if you disable cropping it would be much better, when it comes to PSD files, this kind of cropping of layers is not that useful. If you could somehow enable clip-mask layers, then it would be a much more practical cropping, otherwise, just ignoring the right, bottom and letting the layer be the size of the it's canvas without cropping makes more sense in my opinion.\r\n\r\n-----------------------------------\r\nAll that said, I want to thank you for this wonderfully great library you have created, it truely is a lifesaver for us."}}
{"actor":{"display_login":"human-a"}}