{"action":"created","comment":{"url":"https://api.github.com/repos/kangax/fabric.js/pulls/comments/31582197","id":31582197,"diff_hunk":"@@ -83,25 +96,32 @@\n \n     /**\n      * @private\n+     * @param {Boolean} [unchangeCoords] if true, coordinates of objects enclosed in a group do not change\n      */\n-    _updateObjectsCoords: function() {\n-      this.forEachObject(this._updateObjectCoords, this);\n+    _updateObjectsCoords: function(unchangeCoords) {\n+      for (var i = this._objects.length; i--; ){\n+        this._updateObjectCoords(this._objects[i], unchangeCoords);\n+      }\n     },\n \n     /**\n      * @private\n-     */\n-    _updateObjectCoords: function(object) {\n-      var objectLeft = object.getLeft(),\n-          objectTop = object.getTop(),\n-          center = this.getCenterPoint();\n-\n-      object.set({\n-        originalLeft: objectLeft,\n-        originalTop: objectTop,\n-        left: objectLeft - center.x,\n-        top: objectTop - center.y\n-      });\n+     * @param {Object} object\n+     * @param {Boolean} [unchangeCoords] if true, coordinates of object dose not change\n+     */\n+    _updateObjectCoords: function(object, unchangeCoords) {\n+      if (!unchangeCoords) {","path":"src/shapes/group.class.js","position":79,"original_position":79,"commit_id":"746b87dfcb7dc2d5687720f661707672a0331661","original_commit_id":"746b87dfcb7dc2d5687720f661707672a0331661","user":{"login":"sapics","id":11169954,"avatar_url":"https://avatars.githubusercontent.com/u/11169954?v=3","gravatar_id":"","url":"https://api.github.com/users/sapics","html_url":"https://github.com/sapics","followers_url":"https://api.github.com/users/sapics/followers","following_url":"https://api.github.com/users/sapics/following{/other_user}","gists_url":"https://api.github.com/users/sapics/gists{/gist_id}","starred_url":"https://api.github.com/users/sapics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapics/subscriptions","organizations_url":"https://api.github.com/users/sapics/orgs","repos_url":"https://api.github.com/users/sapics/repos","events_url":"https://api.github.com/users/sapics/events{/privacy}","received_events_url":"https://api.github.com/users/sapics/received_events","type":"User","site_admin":false},"body":"I undestand! Thanks :)","created_at":"2015-06-02T23:36:34Z","updated_at":"2015-06-02T23:36:34Z","html_url":"https://github.com/kangax/fabric.js/pull/2101#discussion_r31582197","pull_request_url":"https://api.github.com/repos/kangax/fabric.js/pulls/2101","_links":{"self":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/comments/31582197"},"html":{"href":"https://github.com/kangax/fabric.js/pull/2101#discussion_r31582197"},"pull_request":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/2101"}}},"pull_request":{"url":"https://api.github.com/repos/kangax/fabric.js/pulls/2101","id":32927992,"html_url":"https://github.com/kangax/fabric.js/pull/2101","diff_url":"https://github.com/kangax/fabric.js/pull/2101.diff","patch_url":"https://github.com/kangax/fabric.js/pull/2101.patch","issue_url":"https://api.github.com/repos/kangax/fabric.js/issues/2101","number":2101,"state":"open","locked":false,"title":"Fix group initialization","user":{"login":"sapics","id":11169954,"avatar_url":"https://avatars.githubusercontent.com/u/11169954?v=3","gravatar_id":"","url":"https://api.github.com/users/sapics","html_url":"https://github.com/sapics","followers_url":"https://api.github.com/users/sapics/followers","following_url":"https://api.github.com/users/sapics/following{/other_user}","gists_url":"https://api.github.com/users/sapics/gists{/gist_id}","starred_url":"https://api.github.com/users/sapics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapics/subscriptions","organizations_url":"https://api.github.com/users/sapics/orgs","repos_url":"https://api.github.com/users/sapics/repos","events_url":"https://api.github.com/users/sapics/events{/privacy}","received_events_url":"https://api.github.com/users/sapics/received_events","type":"User","site_admin":false},"body":"#2095 @chrisrickard reported a problem of `group.toObject`. This PR would fix it.\r\nThere are two fixed points.\r\n\r\n1. If toObject copied delegatedProperties, it affects to grouped objects at initialization (https://github.com/kangax/fabric.js/blob/master/src/shapes/group.class.js#L72).\r\nI removed delegatedProperties at toObject function, but it is also possible to fix by changing group initialization code. I felt that fix at toObject will be better for consistency.\r\n\r\n~~2. At toObject, _objects copied normally. However, at initialization, _objects coordinates are updated (https://github.com/kangax/fabric.js/blob/master/src/shapes/group.class.js#L70).\r\nIt makes change position of grouped objects.\r\nTo fix it, I use _restoreObjectsState, before copying _objects.~~\r\n\r\ncloses #2119\r\ncloses #2095","created_at":"2015-04-09T06:20:12Z","updated_at":"2015-06-02T23:36:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"647482b0b530956d7698e6b00136d4942e998999","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kangax/fabric.js/pulls/2101/commits","review_comments_url":"https://api.github.com/repos/kangax/fabric.js/pulls/2101/comments","review_comment_url":"https://api.github.com/repos/kangax/fabric.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kangax/fabric.js/issues/2101/comments","statuses_url":"https://api.github.com/repos/kangax/fabric.js/statuses/746b87dfcb7dc2d5687720f661707672a0331661","head":{"label":"sapics:fix_group_to_object","ref":"fix_group_to_object","sha":"746b87dfcb7dc2d5687720f661707672a0331661","user":{"login":"sapics","id":11169954,"avatar_url":"https://avatars.githubusercontent.com/u/11169954?v=3","gravatar_id":"","url":"https://api.github.com/users/sapics","html_url":"https://github.com/sapics","followers_url":"https://api.github.com/users/sapics/followers","following_url":"https://api.github.com/users/sapics/following{/other_user}","gists_url":"https://api.github.com/users/sapics/gists{/gist_id}","starred_url":"https://api.github.com/users/sapics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapics/subscriptions","organizations_url":"https://api.github.com/users/sapics/orgs","repos_url":"https://api.github.com/users/sapics/repos","events_url":"https://api.github.com/users/sapics/events{/privacy}","received_events_url":"https://api.github.com/users/sapics/received_events","type":"User","site_admin":false},"repo":{"id":31289752,"name":"fabric.js","full_name":"sapics/fabric.js","owner":{"login":"sapics","id":11169954,"avatar_url":"https://avatars.githubusercontent.com/u/11169954?v=3","gravatar_id":"","url":"https://api.github.com/users/sapics","html_url":"https://github.com/sapics","followers_url":"https://api.github.com/users/sapics/followers","following_url":"https://api.github.com/users/sapics/following{/other_user}","gists_url":"https://api.github.com/users/sapics/gists{/gist_id}","starred_url":"https://api.github.com/users/sapics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapics/subscriptions","organizations_url":"https://api.github.com/users/sapics/orgs","repos_url":"https://api.github.com/users/sapics/repos","events_url":"https://api.github.com/users/sapics/events{/privacy}","received_events_url":"https://api.github.com/users/sapics/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sapics/fabric.js","description":"Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser","fork":true,"url":"https://api.github.com/repos/sapics/fabric.js","forks_url":"https://api.github.com/repos/sapics/fabric.js/forks","keys_url":"https://api.github.com/repos/sapics/fabric.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sapics/fabric.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sapics/fabric.js/teams","hooks_url":"https://api.github.com/repos/sapics/fabric.js/hooks","issue_events_url":"https://api.github.com/repos/sapics/fabric.js/issues/events{/number}","events_url":"https://api.github.com/repos/sapics/fabric.js/events","assignees_url":"https://api.github.com/repos/sapics/fabric.js/assignees{/user}","branches_url":"https://api.github.com/repos/sapics/fabric.js/branches{/branch}","tags_url":"https://api.github.com/repos/sapics/fabric.js/tags","blobs_url":"https://api.github.com/repos/sapics/fabric.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sapics/fabric.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sapics/fabric.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/sapics/fabric.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sapics/fabric.js/statuses/{sha}","languages_url":"https://api.github.com/repos/sapics/fabric.js/languages","stargazers_url":"https://api.github.com/repos/sapics/fabric.js/stargazers","contributors_url":"https://api.github.com/repos/sapics/fabric.js/contributors","subscribers_url":"https://api.github.com/repos/sapics/fabric.js/subscribers","subscription_url":"https://api.github.com/repos/sapics/fabric.js/subscription","commits_url":"https://api.github.com/repos/sapics/fabric.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/sapics/fabric.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/sapics/fabric.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/sapics/fabric.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/sapics/fabric.js/contents/{+path}","compare_url":"https://api.github.com/repos/sapics/fabric.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sapics/fabric.js/merges","archive_url":"https://api.github.com/repos/sapics/fabric.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sapics/fabric.js/downloads","issues_url":"https://api.github.com/repos/sapics/fabric.js/issues{/number}","pulls_url":"https://api.github.com/repos/sapics/fabric.js/pulls{/number}","milestones_url":"https://api.github.com/repos/sapics/fabric.js/milestones{/number}","notifications_url":"https://api.github.com/repos/sapics/fabric.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sapics/fabric.js/labels{/name}","releases_url":"https://api.github.com/repos/sapics/fabric.js/releases{/id}","created_at":"2015-02-25T00:40:15Z","updated_at":"2015-05-07T00:42:01Z","pushed_at":"2015-06-01T23:23:26Z","git_url":"git://github.com/sapics/fabric.js.git","ssh_url":"git@github.com:sapics/fabric.js.git","clone_url":"https://github.com/sapics/fabric.js.git","svn_url":"https://github.com/sapics/fabric.js","homepage":"http://fabricjs.com","size":96500,"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":"kangax:master","ref":"master","sha":"c71a1c20498af8a0687bf8b9ceacb48e256e1812","user":{"login":"kangax","id":383,"avatar_url":"https://avatars.githubusercontent.com/u/383?v=3","gravatar_id":"","url":"https://api.github.com/users/kangax","html_url":"https://github.com/kangax","followers_url":"https://api.github.com/users/kangax/followers","following_url":"https://api.github.com/users/kangax/following{/other_user}","gists_url":"https://api.github.com/users/kangax/gists{/gist_id}","starred_url":"https://api.github.com/users/kangax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangax/subscriptions","organizations_url":"https://api.github.com/users/kangax/orgs","repos_url":"https://api.github.com/users/kangax/repos","events_url":"https://api.github.com/users/kangax/events{/privacy}","received_events_url":"https://api.github.com/users/kangax/received_events","type":"User","site_admin":false},"repo":{"id":712530,"name":"fabric.js","full_name":"kangax/fabric.js","owner":{"login":"kangax","id":383,"avatar_url":"https://avatars.githubusercontent.com/u/383?v=3","gravatar_id":"","url":"https://api.github.com/users/kangax","html_url":"https://github.com/kangax","followers_url":"https://api.github.com/users/kangax/followers","following_url":"https://api.github.com/users/kangax/following{/other_user}","gists_url":"https://api.github.com/users/kangax/gists{/gist_id}","starred_url":"https://api.github.com/users/kangax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangax/subscriptions","organizations_url":"https://api.github.com/users/kangax/orgs","repos_url":"https://api.github.com/users/kangax/repos","events_url":"https://api.github.com/users/kangax/events{/privacy}","received_events_url":"https://api.github.com/users/kangax/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kangax/fabric.js","description":"Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser","fork":false,"url":"https://api.github.com/repos/kangax/fabric.js","forks_url":"https://api.github.com/repos/kangax/fabric.js/forks","keys_url":"https://api.github.com/repos/kangax/fabric.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kangax/fabric.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kangax/fabric.js/teams","hooks_url":"https://api.github.com/repos/kangax/fabric.js/hooks","issue_events_url":"https://api.github.com/repos/kangax/fabric.js/issues/events{/number}","events_url":"https://api.github.com/repos/kangax/fabric.js/events","assignees_url":"https://api.github.com/repos/kangax/fabric.js/assignees{/user}","branches_url":"https://api.github.com/repos/kangax/fabric.js/branches{/branch}","tags_url":"https://api.github.com/repos/kangax/fabric.js/tags","blobs_url":"https://api.github.com/repos/kangax/fabric.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kangax/fabric.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kangax/fabric.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/kangax/fabric.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kangax/fabric.js/statuses/{sha}","languages_url":"https://api.github.com/repos/kangax/fabric.js/languages","stargazers_url":"https://api.github.com/repos/kangax/fabric.js/stargazers","contributors_url":"https://api.github.com/repos/kangax/fabric.js/contributors","subscribers_url":"https://api.github.com/repos/kangax/fabric.js/subscribers","subscription_url":"https://api.github.com/repos/kangax/fabric.js/subscription","commits_url":"https://api.github.com/repos/kangax/fabric.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/kangax/fabric.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/kangax/fabric.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/kangax/fabric.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/kangax/fabric.js/contents/{+path}","compare_url":"https://api.github.com/repos/kangax/fabric.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kangax/fabric.js/merges","archive_url":"https://api.github.com/repos/kangax/fabric.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kangax/fabric.js/downloads","issues_url":"https://api.github.com/repos/kangax/fabric.js/issues{/number}","pulls_url":"https://api.github.com/repos/kangax/fabric.js/pulls{/number}","milestones_url":"https://api.github.com/repos/kangax/fabric.js/milestones{/number}","notifications_url":"https://api.github.com/repos/kangax/fabric.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kangax/fabric.js/labels{/name}","releases_url":"https://api.github.com/repos/kangax/fabric.js/releases{/id}","created_at":"2010-06-09T22:24:38Z","updated_at":"2015-06-02T18:34:45Z","pushed_at":"2015-06-02T21:05:54Z","git_url":"git://github.com/kangax/fabric.js.git","ssh_url":"git@github.com:kangax/fabric.js.git","clone_url":"https://github.com/kangax/fabric.js.git","svn_url":"https://github.com/kangax/fabric.js","homepage":"http://fabricjs.com","size":114273,"stargazers_count":4383,"watchers_count":4383,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":747,"mirror_url":null,"open_issues_count":245,"forks":747,"open_issues":245,"watchers":4383,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/2101"},"html":{"href":"https://github.com/kangax/fabric.js/pull/2101"},"issue":{"href":"https://api.github.com/repos/kangax/fabric.js/issues/2101"},"comments":{"href":"https://api.github.com/repos/kangax/fabric.js/issues/2101/comments"},"review_comments":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/2101/comments"},"review_comment":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/2101/commits"},"statuses":{"href":"https://api.github.com/repos/kangax/fabric.js/statuses/746b87dfcb7dc2d5687720f661707672a0331661"}}}}