{"action":"created","comment":{"url":"https://api.github.com/repos/processing/p5.js/pulls/comments/41260653","id":41260653,"diff_hunk":"@@ -912,19 +912,72 @@\n    * </code></div>\n    */\n   p5.Element.prototype.style = function(prop, val) {\n+    var self = this;\n+\n     if (typeof val === 'undefined') {\n-      var attrs = prop.split(';');\n-      for (var i=0; i<attrs.length; i++) {\n-        var parts = attrs[i].split(':');\n-        if (parts[0] && parts[1]) {\n-          this.elt.style[parts[0].trim()] = parts[1].trim();\n+      if (!prop.match(/:/)) {\n+        var styles = window.getComputedStyle(self.elt);\n+        var style = styles.getPropertyValue(prop);\n+        return style;\n+      } else {\n+        var attrs = prop.split(';');\n+        for (var i = 0; i < attrs.length; i++) {\n+          var parts = attrs[i].split(':');\n+          if (parts[0] && parts[1]) {\n+            this.elt.style[parts[0].trim()] = parts[1].trim();\n+          }\n         }\n       }\n     } else {\n-      this.elt.style[prop] = val;\n-      if (prop === 'width' || prop === 'height' || prop === 'left' || prop === 'top'){\n-        var numVal = val.replace(/\\D+/g,'');\n-        this[prop] = parseInt(numVal);\n+      if (prop.match(/rotate/)) {\n+        if (arguments.length === 2) {\n+          var style = this.elt.style.transform.replace(/rotate3d\\(.*\\)/g, '');\n+          style = style.replace(/rotate[X-Z]?\\(.*\\)/g, '');\n+          this.elt.style.transform = 'rotate(' + arguments[0] + 'deg)';\n+          this.elt.style.transform += style;\n+        } else if (arguments.length === 3) {\n+          var style = this.elt.style.transform.replace(/rotate3d\\(.*\\)/g, '');\n+          style = style.replace(/rotate[X-Z]?\\(.*\\)/g, '');\n+          this.elt.style.transform = 'rotate(' + arguments[0] + 'deg, ' + arguments[1] + 'deg)';\n+          this.elt.style.transform += style;\n+        } else if (arguments.length === 4) {\n+          var style = this.elt.style.transform.replace(/rotate3d\\(.*\\)/g, '');\n+          style = style.replace(/rotate[X-Z]?\\(.*\\)/g, '');\n+          this.elt.style.transform = 'rotateX(' + arguments[0] + 'deg)';\n+          this.elt.style.transform += 'rotateY(' + arguments[1] + 'deg)';\n+          this.elt.style.transform += 'rotateZ(' + arguments[2] + 'deg)';\n+          this.elt.style.transform += style;\n+        }\n+      } else if (prop.match(/translate/)) {","path":"lib/addons/p5.dom.js","position":49,"original_position":49,"commit_id":"996760505254e40def41b9abd353979ddfb8e421","original_commit_id":"996760505254e40def41b9abd353979ddfb8e421","user":{"login":"lmccart","id":191056,"avatar_url":"https://avatars.githubusercontent.com/u/191056?v=3","gravatar_id":"","url":"https://api.github.com/users/lmccart","html_url":"https://github.com/lmccart","followers_url":"https://api.github.com/users/lmccart/followers","following_url":"https://api.github.com/users/lmccart/following{/other_user}","gists_url":"https://api.github.com/users/lmccart/gists{/gist_id}","starred_url":"https://api.github.com/users/lmccart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmccart/subscriptions","organizations_url":"https://api.github.com/users/lmccart/orgs","repos_url":"https://api.github.com/users/lmccart/repos","events_url":"https://api.github.com/users/lmccart/events{/privacy}","received_events_url":"https://api.github.com/users/lmccart/received_events","type":"User","site_admin":false},"body":"let's change this to:\r\nif (prop === 'translate') {","created_at":"2015-10-06T13:08:41Z","updated_at":"2015-10-06T13:08:41Z","html_url":"https://github.com/processing/p5.js/pull/983#discussion_r41260653","pull_request_url":"https://api.github.com/repos/processing/p5.js/pulls/983","_links":{"self":{"href":"https://api.github.com/repos/processing/p5.js/pulls/comments/41260653"},"html":{"href":"https://github.com/processing/p5.js/pull/983#discussion_r41260653"},"pull_request":{"href":"https://api.github.com/repos/processing/p5.js/pulls/983"}}},"pull_request":{"url":"https://api.github.com/repos/processing/p5.js/pulls/983","id":46856493,"html_url":"https://github.com/processing/p5.js/pull/983","diff_url":"https://github.com/processing/p5.js/pull/983.diff","patch_url":"https://github.com/processing/p5.js/pull/983.patch","issue_url":"https://api.github.com/repos/processing/p5.js/issues/983","number":983,"state":"open","locked":false,"title":"more support for style","user":{"login":"futuremarc","id":8646752,"avatar_url":"https://avatars.githubusercontent.com/u/8646752?v=3","gravatar_id":"","url":"https://api.github.com/users/futuremarc","html_url":"https://github.com/futuremarc","followers_url":"https://api.github.com/users/futuremarc/followers","following_url":"https://api.github.com/users/futuremarc/following{/other_user}","gists_url":"https://api.github.com/users/futuremarc/gists{/gist_id}","starred_url":"https://api.github.com/users/futuremarc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuremarc/subscriptions","organizations_url":"https://api.github.com/users/futuremarc/orgs","repos_url":"https://api.github.com/users/futuremarc/repos","events_url":"https://api.github.com/users/futuremarc/events{/privacy}","received_events_url":"https://api.github.com/users/futuremarc/received_events","type":"User","site_admin":false},"body":"addresses #954","created_at":"2015-10-06T02:25:39Z","updated_at":"2015-10-06T13:08:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb70356b93829bfc39a048a78a0bd263f105c32a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/processing/p5.js/pulls/983/commits","review_comments_url":"https://api.github.com/repos/processing/p5.js/pulls/983/comments","review_comment_url":"https://api.github.com/repos/processing/p5.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/processing/p5.js/issues/983/comments","statuses_url":"https://api.github.com/repos/processing/p5.js/statuses/996760505254e40def41b9abd353979ddfb8e421","head":{"label":"futuremarc:style","ref":"style","sha":"996760505254e40def41b9abd353979ddfb8e421","user":{"login":"futuremarc","id":8646752,"avatar_url":"https://avatars.githubusercontent.com/u/8646752?v=3","gravatar_id":"","url":"https://api.github.com/users/futuremarc","html_url":"https://github.com/futuremarc","followers_url":"https://api.github.com/users/futuremarc/followers","following_url":"https://api.github.com/users/futuremarc/following{/other_user}","gists_url":"https://api.github.com/users/futuremarc/gists{/gist_id}","starred_url":"https://api.github.com/users/futuremarc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuremarc/subscriptions","organizations_url":"https://api.github.com/users/futuremarc/orgs","repos_url":"https://api.github.com/users/futuremarc/repos","events_url":"https://api.github.com/users/futuremarc/events{/privacy}","received_events_url":"https://api.github.com/users/futuremarc/received_events","type":"User","site_admin":false},"repo":{"id":33744284,"name":"p5.js","full_name":"futuremarc/p5.js","owner":{"login":"futuremarc","id":8646752,"avatar_url":"https://avatars.githubusercontent.com/u/8646752?v=3","gravatar_id":"","url":"https://api.github.com/users/futuremarc","html_url":"https://github.com/futuremarc","followers_url":"https://api.github.com/users/futuremarc/followers","following_url":"https://api.github.com/users/futuremarc/following{/other_user}","gists_url":"https://api.github.com/users/futuremarc/gists{/gist_id}","starred_url":"https://api.github.com/users/futuremarc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuremarc/subscriptions","organizations_url":"https://api.github.com/users/futuremarc/orgs","repos_url":"https://api.github.com/users/futuremarc/repos","events_url":"https://api.github.com/users/futuremarc/events{/privacy}","received_events_url":"https://api.github.com/users/futuremarc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/futuremarc/p5.js","description":"A JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing. http://twitter.com/p5xjs —","fork":true,"url":"https://api.github.com/repos/futuremarc/p5.js","forks_url":"https://api.github.com/repos/futuremarc/p5.js/forks","keys_url":"https://api.github.com/repos/futuremarc/p5.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/futuremarc/p5.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/futuremarc/p5.js/teams","hooks_url":"https://api.github.com/repos/futuremarc/p5.js/hooks","issue_events_url":"https://api.github.com/repos/futuremarc/p5.js/issues/events{/number}","events_url":"https://api.github.com/repos/futuremarc/p5.js/events","assignees_url":"https://api.github.com/repos/futuremarc/p5.js/assignees{/user}","branches_url":"https://api.github.com/repos/futuremarc/p5.js/branches{/branch}","tags_url":"https://api.github.com/repos/futuremarc/p5.js/tags","blobs_url":"https://api.github.com/repos/futuremarc/p5.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/futuremarc/p5.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/futuremarc/p5.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/futuremarc/p5.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/futuremarc/p5.js/statuses/{sha}","languages_url":"https://api.github.com/repos/futuremarc/p5.js/languages","stargazers_url":"https://api.github.com/repos/futuremarc/p5.js/stargazers","contributors_url":"https://api.github.com/repos/futuremarc/p5.js/contributors","subscribers_url":"https://api.github.com/repos/futuremarc/p5.js/subscribers","subscription_url":"https://api.github.com/repos/futuremarc/p5.js/subscription","commits_url":"https://api.github.com/repos/futuremarc/p5.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/futuremarc/p5.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/futuremarc/p5.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/futuremarc/p5.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/futuremarc/p5.js/contents/{+path}","compare_url":"https://api.github.com/repos/futuremarc/p5.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/futuremarc/p5.js/merges","archive_url":"https://api.github.com/repos/futuremarc/p5.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/futuremarc/p5.js/downloads","issues_url":"https://api.github.com/repos/futuremarc/p5.js/issues{/number}","pulls_url":"https://api.github.com/repos/futuremarc/p5.js/pulls{/number}","milestones_url":"https://api.github.com/repos/futuremarc/p5.js/milestones{/number}","notifications_url":"https://api.github.com/repos/futuremarc/p5.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/futuremarc/p5.js/labels{/name}","releases_url":"https://api.github.com/repos/futuremarc/p5.js/releases{/id}","created_at":"2015-04-10T18:31:53Z","updated_at":"2015-04-10T18:31:54Z","pushed_at":"2015-10-06T02:25:10Z","git_url":"git://github.com/futuremarc/p5.js.git","ssh_url":"git@github.com:futuremarc/p5.js.git","clone_url":"https://github.com/futuremarc/p5.js.git","svn_url":"https://github.com/futuremarc/p5.js","homepage":"http://p5js.org/","size":55510,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"processing:master","ref":"master","sha":"6e45fbb6ac9379c88b492ba9a0af73c838ac37dc","user":{"login":"processing","id":1617169,"avatar_url":"https://avatars.githubusercontent.com/u/1617169?v=3","gravatar_id":"","url":"https://api.github.com/users/processing","html_url":"https://github.com/processing","followers_url":"https://api.github.com/users/processing/followers","following_url":"https://api.github.com/users/processing/following{/other_user}","gists_url":"https://api.github.com/users/processing/gists{/gist_id}","starred_url":"https://api.github.com/users/processing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/processing/subscriptions","organizations_url":"https://api.github.com/users/processing/orgs","repos_url":"https://api.github.com/users/processing/repos","events_url":"https://api.github.com/users/processing/events{/privacy}","received_events_url":"https://api.github.com/users/processing/received_events","type":"Organization","site_admin":false},"repo":{"id":8424040,"name":"p5.js","full_name":"processing/p5.js","owner":{"login":"processing","id":1617169,"avatar_url":"https://avatars.githubusercontent.com/u/1617169?v=3","gravatar_id":"","url":"https://api.github.com/users/processing","html_url":"https://github.com/processing","followers_url":"https://api.github.com/users/processing/followers","following_url":"https://api.github.com/users/processing/following{/other_user}","gists_url":"https://api.github.com/users/processing/gists{/gist_id}","starred_url":"https://api.github.com/users/processing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/processing/subscriptions","organizations_url":"https://api.github.com/users/processing/orgs","repos_url":"https://api.github.com/users/processing/repos","events_url":"https://api.github.com/users/processing/events{/privacy}","received_events_url":"https://api.github.com/users/processing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/processing/p5.js","description":"p5.js is a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing. http://twitter.com/p5xjs —","fork":false,"url":"https://api.github.com/repos/processing/p5.js","forks_url":"https://api.github.com/repos/processing/p5.js/forks","keys_url":"https://api.github.com/repos/processing/p5.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/processing/p5.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/processing/p5.js/teams","hooks_url":"https://api.github.com/repos/processing/p5.js/hooks","issue_events_url":"https://api.github.com/repos/processing/p5.js/issues/events{/number}","events_url":"https://api.github.com/repos/processing/p5.js/events","assignees_url":"https://api.github.com/repos/processing/p5.js/assignees{/user}","branches_url":"https://api.github.com/repos/processing/p5.js/branches{/branch}","tags_url":"https://api.github.com/repos/processing/p5.js/tags","blobs_url":"https://api.github.com/repos/processing/p5.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/processing/p5.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/processing/p5.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/processing/p5.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/processing/p5.js/statuses/{sha}","languages_url":"https://api.github.com/repos/processing/p5.js/languages","stargazers_url":"https://api.github.com/repos/processing/p5.js/stargazers","contributors_url":"https://api.github.com/repos/processing/p5.js/contributors","subscribers_url":"https://api.github.com/repos/processing/p5.js/subscribers","subscription_url":"https://api.github.com/repos/processing/p5.js/subscription","commits_url":"https://api.github.com/repos/processing/p5.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/processing/p5.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/processing/p5.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/processing/p5.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/processing/p5.js/contents/{+path}","compare_url":"https://api.github.com/repos/processing/p5.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/processing/p5.js/merges","archive_url":"https://api.github.com/repos/processing/p5.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/processing/p5.js/downloads","issues_url":"https://api.github.com/repos/processing/p5.js/issues{/number}","pulls_url":"https://api.github.com/repos/processing/p5.js/pulls{/number}","milestones_url":"https://api.github.com/repos/processing/p5.js/milestones{/number}","notifications_url":"https://api.github.com/repos/processing/p5.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/processing/p5.js/labels{/name}","releases_url":"https://api.github.com/repos/processing/p5.js/releases{/id}","created_at":"2013-02-26T03:14:47Z","updated_at":"2015-10-05T21:24:53Z","pushed_at":"2015-10-06T02:25:39Z","git_url":"git://github.com/processing/p5.js.git","ssh_url":"git@github.com:processing/p5.js.git","clone_url":"https://github.com/processing/p5.js.git","svn_url":"https://github.com/processing/p5.js","homepage":"http://p5js.org/","size":69077,"stargazers_count":2972,"watchers_count":2972,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":368,"mirror_url":null,"open_issues_count":51,"forks":368,"open_issues":51,"watchers":2972,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/processing/p5.js/pulls/983"},"html":{"href":"https://github.com/processing/p5.js/pull/983"},"issue":{"href":"https://api.github.com/repos/processing/p5.js/issues/983"},"comments":{"href":"https://api.github.com/repos/processing/p5.js/issues/983/comments"},"review_comments":{"href":"https://api.github.com/repos/processing/p5.js/pulls/983/comments"},"review_comment":{"href":"https://api.github.com/repos/processing/p5.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/processing/p5.js/pulls/983/commits"},"statuses":{"href":"https://api.github.com/repos/processing/p5.js/statuses/996760505254e40def41b9abd353979ddfb8e421"}}}}