{"action":"created","issue":{"url":"https://api.github.com/repos/fjenett/javascript-mode-processing/issues/23","labels_url":"https://api.github.com/repos/fjenett/javascript-mode-processing/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/fjenett/javascript-mode-processing/issues/23/comments","events_url":"https://api.github.com/repos/fjenett/javascript-mode-processing/issues/23/events","html_url":"https://github.com/fjenett/javascript-mode-processing/issues/23","id":72886304,"number":23,"title":"Should be able to determine sketch size when it is computed only from constants","user":{"login":"teo1978","id":542107,"avatar_url":"https://avatars.githubusercontent.com/u/542107?v=3","gravatar_id":"","url":"https://api.github.com/users/teo1978","html_url":"https://github.com/teo1978","followers_url":"https://api.github.com/users/teo1978/followers","following_url":"https://api.github.com/users/teo1978/following{/other_user}","gists_url":"https://api.github.com/users/teo1978/gists{/gist_id}","starred_url":"https://api.github.com/users/teo1978/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teo1978/subscriptions","organizations_url":"https://api.github.com/users/teo1978/orgs","repos_url":"https://api.github.com/users/teo1978/repos","events_url":"https://api.github.com/users/teo1978/events{/privacy}","received_events_url":"https://api.github.com/users/teo1978/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-04T00:07:12Z","updated_at":"2015-05-07T12:19:17Z","closed_at":"2015-05-07T08:41:58Z","body":"Example code:\r\n```\r\nstatic final int WID=400;\r\nstatic final int HEI=400;\r\n\r\n\r\nvoid setup() {\r\n  size(WID,HEI);\r\n}\r\n```\r\n\r\nlet alone this:\r\n\r\n```\r\nstatic final int WID=400;\r\nstatic final int FACTOR=2;\r\nstatic final int HEI=400;\r\n\r\n\r\nvoid setup() {\r\n  size(WID*FACTOR,HEI);\r\n}\r\n```\r\n\r\nExpected: both should export just fine, since the provided values are constants.\r\n\r\nObserved: it issues an error, which I have to remember because it only shows up once (i'll report that as a separate bug), which says more or less:\r\n> The size of the sketch cannot be determined from your code. You'll have to edit the html...\r\n"},"comment":{"url":"https://api.github.com/repos/fjenett/javascript-mode-processing/issues/comments/99842245","html_url":"https://github.com/fjenett/javascript-mode-processing/issues/23#issuecomment-99842245","issue_url":"https://api.github.com/repos/fjenett/javascript-mode-processing/issues/23","id":99842245,"user":{"login":"teo1978","id":542107,"avatar_url":"https://avatars.githubusercontent.com/u/542107?v=3","gravatar_id":"","url":"https://api.github.com/users/teo1978","html_url":"https://github.com/teo1978","followers_url":"https://api.github.com/users/teo1978/followers","following_url":"https://api.github.com/users/teo1978/following{/other_user}","gists_url":"https://api.github.com/users/teo1978/gists{/gist_id}","starred_url":"https://api.github.com/users/teo1978/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teo1978/subscriptions","organizations_url":"https://api.github.com/users/teo1978/orgs","repos_url":"https://api.github.com/users/teo1978/repos","events_url":"https://api.github.com/users/teo1978/events{/privacy}","received_events_url":"https://api.github.com/users/teo1978/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T12:19:17Z","updated_at":"2015-05-07T12:19:17Z","body":"> The message is not an error as the sketch will run fine afterwards. \r\n\r\nExcept that you'll see only a portion of the canvas, because it will be wrapped in a div that has 300px max-width, and 100px width. I wouldn't call that \"working fine\".\r\n\r\nIf you cannot compute the sketch size (but see below), then I think you should consider rewriting the html and css of the template index.html so that it doesn't need to have the size hard-coded anywhere (except in the canvas, which will be resized dynamically by processing.js so it's fine). That should definitely be possible, and not even that hard, so I think you're being a bit too quick in closing this issue, with all due respect.\r\n\r\n> There are no constants in JavaScript.\r\nI know that. But there are in Java and when JavaScript Mode runs it has access to the pde source code, doesn't it? I thought it would be possible (not saying it would be easy at all) to resolve the value of the constant.\r\nAnyway, probably the solution above is much simpler.\r\n"}}