{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments/46467743","id":46467743,"diff_hunk":"@@ -1089,6 +1089,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {\n \n       if (isPatternFill) {\n         ctx.save();\n+        var m = this.baseTransform ||\n+                this.ctx.mozCurrentTransform.slice();\n+        ctx.setTransform(m[0], m[1], m[2], m[3], m[4], m[5]);","path":"src/display/canvas.js","position":6,"original_position":6,"commit_id":"8792f3dbf8cff2fb06a2df5c8010fe319af55837","original_commit_id":"8792f3dbf8cff2fb06a2df5c8010fe319af55837","user":{"login":"dsprenkels","id":439973,"avatar_url":"https://avatars.githubusercontent.com/u/439973?v=3","gravatar_id":"","url":"https://api.github.com/users/dsprenkels","html_url":"https://github.com/dsprenkels","followers_url":"https://api.github.com/users/dsprenkels/followers","following_url":"https://api.github.com/users/dsprenkels/following{/other_user}","gists_url":"https://api.github.com/users/dsprenkels/gists{/gist_id}","starred_url":"https://api.github.com/users/dsprenkels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsprenkels/subscriptions","organizations_url":"https://api.github.com/users/dsprenkels/orgs","repos_url":"https://api.github.com/users/dsprenkels/repos","events_url":"https://api.github.com/users/dsprenkels/events{/privacy}","received_events_url":"https://api.github.com/users/dsprenkels/received_events","type":"User","site_admin":false},"body":"> So this code just performs: if (this.baseTransform) { ctx.setTransform.apply(ctx, this.baseTransform); }? (Now I wonder if we ever will get this.baseTransform == null.)\r\nI initially just used `this.baseTransform`, got `null` in some test cases from the test suite, and saw that in other places the expression `this.baseTransform || this.ctx.mozCurrentTransform.slice();` was used. I did not know that the current tranformation was actually stored in `this.ctx.mozCurrentTransform`, (although now it makes a lot of sense).\r\nYou are right that this piece of code could better be `if (this.baseTransform) { ctx.setTransform.apply(ctx, this.baseTransform); }`.\r\n\r\n> Shall stroke have the same statements?\r\nI some manner of speaking: \"Yes\". However, when transforming the stroke, the stroke width would be transformed as well. I do not know if other side effects occur when using `ctx.setTransform()`, that's why I initially thought that it may be a better idea to not use `ctx.save()` and `ctx.restore()`, but to alter the matrices of the patterns directly.","created_at":"2015-12-02T20:05:57Z","updated_at":"2015-12-02T20:05:57Z","html_url":"https://github.com/mozilla/pdf.js/pull/6684#discussion_r46467743","pull_request_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684","_links":{"self":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments/46467743"},"html":{"href":"https://github.com/mozilla/pdf.js/pull/6684#discussion_r46467743"},"pull_request":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684","id":51674280,"html_url":"https://github.com/mozilla/pdf.js/pull/6684","diff_url":"https://github.com/mozilla/pdf.js/pull/6684.diff","patch_url":"https://github.com/mozilla/pdf.js/pull/6684.patch","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6684","number":6684,"state":"open","locked":false,"title":"shading-pattern: While drawing patterns, use transform to baseTransform first","user":{"login":"dsprenkels","id":439973,"avatar_url":"https://avatars.githubusercontent.com/u/439973?v=3","gravatar_id":"","url":"https://api.github.com/users/dsprenkels","html_url":"https://github.com/dsprenkels","followers_url":"https://api.github.com/users/dsprenkels/followers","following_url":"https://api.github.com/users/dsprenkels/following{/other_user}","gists_url":"https://api.github.com/users/dsprenkels/gists{/gist_id}","starred_url":"https://api.github.com/users/dsprenkels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsprenkels/subscriptions","organizations_url":"https://api.github.com/users/dsprenkels/orgs","repos_url":"https://api.github.com/users/dsprenkels/repos","events_url":"https://api.github.com/users/dsprenkels/events{/privacy}","received_events_url":"https://api.github.com/users/dsprenkels/received_events","type":"User","site_admin":false},"body":"I propose a fix for issue #6296.\r\n\r\nI am, however, a bit uncertain about the implementation: maybe it would be better to alter the coordinates directly, instead of using `ctx.save()` and `ctx.restore()`. (Or maybe doing this in `RadialAxialClosure`).","created_at":"2015-11-24T15:31:19Z","updated_at":"2015-12-02T20:05:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6121215a6f68734ef1892470de569cc2ecf88d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684/commits","review_comments_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684/comments","review_comment_url":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/6684/comments","statuses_url":"https://api.github.com/repos/mozilla/pdf.js/statuses/8792f3dbf8cff2fb06a2df5c8010fe319af55837","head":{"label":"dsprenkels:issue-6296-radial-shading-size","ref":"issue-6296-radial-shading-size","sha":"8792f3dbf8cff2fb06a2df5c8010fe319af55837","user":{"login":"dsprenkels","id":439973,"avatar_url":"https://avatars.githubusercontent.com/u/439973?v=3","gravatar_id":"","url":"https://api.github.com/users/dsprenkels","html_url":"https://github.com/dsprenkels","followers_url":"https://api.github.com/users/dsprenkels/followers","following_url":"https://api.github.com/users/dsprenkels/following{/other_user}","gists_url":"https://api.github.com/users/dsprenkels/gists{/gist_id}","starred_url":"https://api.github.com/users/dsprenkels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsprenkels/subscriptions","organizations_url":"https://api.github.com/users/dsprenkels/orgs","repos_url":"https://api.github.com/users/dsprenkels/repos","events_url":"https://api.github.com/users/dsprenkels/events{/privacy}","received_events_url":"https://api.github.com/users/dsprenkels/received_events","type":"User","site_admin":false},"repo":{"id":39696633,"name":"pdf.js","full_name":"dsprenkels/pdf.js","owner":{"login":"dsprenkels","id":439973,"avatar_url":"https://avatars.githubusercontent.com/u/439973?v=3","gravatar_id":"","url":"https://api.github.com/users/dsprenkels","html_url":"https://github.com/dsprenkels","followers_url":"https://api.github.com/users/dsprenkels/followers","following_url":"https://api.github.com/users/dsprenkels/following{/other_user}","gists_url":"https://api.github.com/users/dsprenkels/gists{/gist_id}","starred_url":"https://api.github.com/users/dsprenkels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsprenkels/subscriptions","organizations_url":"https://api.github.com/users/dsprenkels/orgs","repos_url":"https://api.github.com/users/dsprenkels/repos","events_url":"https://api.github.com/users/dsprenkels/events{/privacy}","received_events_url":"https://api.github.com/users/dsprenkels/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dsprenkels/pdf.js","description":"PDF Reader in JavaScript","fork":true,"url":"https://api.github.com/repos/dsprenkels/pdf.js","forks_url":"https://api.github.com/repos/dsprenkels/pdf.js/forks","keys_url":"https://api.github.com/repos/dsprenkels/pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dsprenkels/pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dsprenkels/pdf.js/teams","hooks_url":"https://api.github.com/repos/dsprenkels/pdf.js/hooks","issue_events_url":"https://api.github.com/repos/dsprenkels/pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/dsprenkels/pdf.js/events","assignees_url":"https://api.github.com/repos/dsprenkels/pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/dsprenkels/pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/dsprenkels/pdf.js/tags","blobs_url":"https://api.github.com/repos/dsprenkels/pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dsprenkels/pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dsprenkels/pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/dsprenkels/pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dsprenkels/pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/dsprenkels/pdf.js/languages","stargazers_url":"https://api.github.com/repos/dsprenkels/pdf.js/stargazers","contributors_url":"https://api.github.com/repos/dsprenkels/pdf.js/contributors","subscribers_url":"https://api.github.com/repos/dsprenkels/pdf.js/subscribers","subscription_url":"https://api.github.com/repos/dsprenkels/pdf.js/subscription","commits_url":"https://api.github.com/repos/dsprenkels/pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/dsprenkels/pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/dsprenkels/pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/dsprenkels/pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/dsprenkels/pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/dsprenkels/pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dsprenkels/pdf.js/merges","archive_url":"https://api.github.com/repos/dsprenkels/pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dsprenkels/pdf.js/downloads","issues_url":"https://api.github.com/repos/dsprenkels/pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/dsprenkels/pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/dsprenkels/pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/dsprenkels/pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dsprenkels/pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/dsprenkels/pdf.js/releases{/id}","created_at":"2015-07-25T17:56:18Z","updated_at":"2015-08-09T13:45:54Z","pushed_at":"2015-11-29T14:32:05Z","git_url":"git://github.com/dsprenkels/pdf.js.git","ssh_url":"git@github.com:dsprenkels/pdf.js.git","clone_url":"https://github.com/dsprenkels/pdf.js.git","svn_url":"https://github.com/dsprenkels/pdf.js","homepage":"","size":48963,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"mozilla:master","ref":"master","sha":"84a47f8e53454e2eccead405454059d0ca5c9826","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1663468,"name":"pdf.js","full_name":"mozilla/pdf.js","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/pdf.js","description":"PDF Reader in JavaScript","fork":false,"url":"https://api.github.com/repos/mozilla/pdf.js","forks_url":"https://api.github.com/repos/mozilla/pdf.js/forks","keys_url":"https://api.github.com/repos/mozilla/pdf.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/pdf.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/pdf.js/teams","hooks_url":"https://api.github.com/repos/mozilla/pdf.js/hooks","issue_events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/pdf.js/events","assignees_url":"https://api.github.com/repos/mozilla/pdf.js/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/pdf.js/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/pdf.js/tags","blobs_url":"https://api.github.com/repos/mozilla/pdf.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/pdf.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/pdf.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/pdf.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/pdf.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/pdf.js/languages","stargazers_url":"https://api.github.com/repos/mozilla/pdf.js/stargazers","contributors_url":"https://api.github.com/repos/mozilla/pdf.js/contributors","subscribers_url":"https://api.github.com/repos/mozilla/pdf.js/subscribers","subscription_url":"https://api.github.com/repos/mozilla/pdf.js/subscription","commits_url":"https://api.github.com/repos/mozilla/pdf.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/pdf.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/pdf.js/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/pdf.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/pdf.js/merges","archive_url":"https://api.github.com/repos/mozilla/pdf.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/pdf.js/downloads","issues_url":"https://api.github.com/repos/mozilla/pdf.js/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/pdf.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/pdf.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/pdf.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/pdf.js/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/pdf.js/releases{/id}","created_at":"2011-04-26T06:32:03Z","updated_at":"2015-12-02T17:22:43Z","pushed_at":"2015-12-02T19:08:57Z","git_url":"git://github.com/mozilla/pdf.js.git","ssh_url":"git@github.com:mozilla/pdf.js.git","clone_url":"https://github.com/mozilla/pdf.js.git","svn_url":"https://github.com/mozilla/pdf.js","homepage":"","size":100342,"stargazers_count":13063,"watchers_count":13063,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3051,"mirror_url":null,"open_issues_count":582,"forks":3051,"open_issues":582,"watchers":13063,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684"},"html":{"href":"https://github.com/mozilla/pdf.js/pull/6684"},"issue":{"href":"https://api.github.com/repos/mozilla/pdf.js/issues/6684"},"comments":{"href":"https://api.github.com/repos/mozilla/pdf.js/issues/6684/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/pdf.js/pulls/6684/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/pdf.js/statuses/8792f3dbf8cff2fb06a2df5c8010fe319af55837"}}}}