{"action":"created","comment":{"url":"https://api.github.com/repos/box/box-content-preview/pulls/comments/131308361","pull_request_review_id":54276170,"id":131308361,"diff_hunk":"@@ -321,12 +323,25 @@ class Annotator extends EventEmitter {\n                 buttonEl.classList.add(CLASS_ACTIVE);\n                 buttonEl.querySelector(SELECTOR_ANNOTATION_BUTTON_DRAW_ENTER).classList.add(CLASS_HIDDEN);\n                 buttonEl.querySelector(SELECTOR_ANNOTATION_BUTTON_DRAW_CANCEL).classList.remove(CLASS_HIDDEN);\n+            }\n+\n+            if (postButtonEl) {\n                 postButtonEl.classList.remove(CLASS_HIDDEN);\n             }\n \n-            const thread = this.createAnnotationThread([], {}, TYPES.draw);\n             this.unbindDOMListeners();\n-            this.bindDrawModeListeners(thread, postButtonEl);\n+\n+            const thread = this.createAnnotationThread([], {}, TYPES.draw);\n+            if (thread) {\n+                this.bindCustomListenersOnThread(thread);\n+                this.bindDrawModeListeners(thread, postButtonEl);\n+                // TODO: @minhnguyen deal with page changes in a better way\n+                thread.addListener('drawthreadcommited', () => {","path":"src/lib/annotations/Annotator.js","position":39,"original_position":39,"commit_id":"18f0444b5bcba7b79d383ed9cd13f2fec37ff5ce","original_commit_id":"18f0444b5bcba7b79d383ed9cd13f2fec37ff5ce","user":{"login":"pramodsum","id":3299001,"avatar_url":"https://avatars3.githubusercontent.com/u/3299001?v=4","gravatar_id":"","url":"https://api.github.com/users/pramodsum","html_url":"https://github.com/pramodsum","followers_url":"https://api.github.com/users/pramodsum/followers","following_url":"https://api.github.com/users/pramodsum/following{/other_user}","gists_url":"https://api.github.com/users/pramodsum/gists{/gist_id}","starred_url":"https://api.github.com/users/pramodsum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pramodsum/subscriptions","organizations_url":"https://api.github.com/users/pramodsum/orgs","repos_url":"https://api.github.com/users/pramodsum/repos","events_url":"https://api.github.com/users/pramodsum/events{/privacy}","received_events_url":"https://api.github.com/users/pramodsum/received_events","type":"User","site_admin":false},"body":"Same thing w/ this","created_at":"2017-08-04T04:08:33Z","updated_at":"2017-08-04T04:08:33Z","html_url":"https://github.com/box/box-content-preview/pull/267#discussion_r131308361","pull_request_url":"https://api.github.com/repos/box/box-content-preview/pulls/267","_links":{"self":{"href":"https://api.github.com/repos/box/box-content-preview/pulls/comments/131308361"},"html":{"href":"https://github.com/box/box-content-preview/pull/267#discussion_r131308361"},"pull_request":{"href":"https://api.github.com/repos/box/box-content-preview/pulls/267"}}},"pull_request":{"url":"https://api.github.com/repos/box/box-content-preview/pulls/267","id":133386957,"html_url":"https://github.com/box/box-content-preview/pull/267","diff_url":"https://github.com/box/box-content-preview/pull/267.diff","patch_url":"https://github.com/box/box-content-preview/pull/267.patch","issue_url":"https://api.github.com/repos/box/box-content-preview/issues/267","number":267,"state":"open","locked":false,"title":"Feature: drawing annotation scaling","user":{"login":"MinhHNguyen","id":4149877,"avatar_url":"https://avatars3.githubusercontent.com/u/4149877?v=4","gravatar_id":"","url":"https://api.github.com/users/MinhHNguyen","html_url":"https://github.com/MinhHNguyen","followers_url":"https://api.github.com/users/MinhHNguyen/followers","following_url":"https://api.github.com/users/MinhHNguyen/following{/other_user}","gists_url":"https://api.github.com/users/MinhHNguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/MinhHNguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinhHNguyen/subscriptions","organizations_url":"https://api.github.com/users/MinhHNguyen/orgs","repos_url":"https://api.github.com/users/MinhHNguyen/repos","events_url":"https://api.github.com/users/MinhHNguyen/events{/privacy}","received_events_url":"https://api.github.com/users/MinhHNguyen/received_events","type":"User","site_admin":false},"body":"Changes\r\n- Use lodash's round function to truncate to a fixed number of decimal places\r\n- requestAnimationFrame is kicked off by handlestart and ended when the drawingflag is no longer 'draw'\r\n- We now use two canvases: a canvas for the committed drawings and a canvas for a drawing in progress (drawing-canvas-mem). In the future, I plan to cut out the boundary of the pending drawing and paste it into the commit canvas, thereby potentially saving on the number of bytes copied.\r\n- Added in DocDrawingThread show(), which is similar to render except render only displays pending drawings whereas show displays committed and pending drawings. In the future, I will investigate how to combine shared logic in both functions. show() is called by the Annotator when it is emitted by a Viewer.\r\n- A drawing path now stores the path as an array of document coordinates. Before drawing, the browser coordinates (browserPath) needs to be computed from the document coordinates. addCoordinate now takes a document coordinate has the option to be given a browser coordinate that will be inserted into the browserPath.\r\n","created_at":"2017-08-01T04:38:18Z","updated_at":"2017-08-04T04:08:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae2b578c13a607ad3711b01e6cb9b3ac49152755","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/box/box-content-preview/pulls/267/commits","review_comments_url":"https://api.github.com/repos/box/box-content-preview/pulls/267/comments","review_comment_url":"https://api.github.com/repos/box/box-content-preview/pulls/comments{/number}","comments_url":"https://api.github.com/repos/box/box-content-preview/issues/267/comments","statuses_url":"https://api.github.com/repos/box/box-content-preview/statuses/18f0444b5bcba7b79d383ed9cd13f2fec37ff5ce","head":{"label":"MinhHNguyen:feature/drawingAnnotationScaling","ref":"feature/drawingAnnotationScaling","sha":"18f0444b5bcba7b79d383ed9cd13f2fec37ff5ce","user":{"login":"MinhHNguyen","id":4149877,"avatar_url":"https://avatars3.githubusercontent.com/u/4149877?v=4","gravatar_id":"","url":"https://api.github.com/users/MinhHNguyen","html_url":"https://github.com/MinhHNguyen","followers_url":"https://api.github.com/users/MinhHNguyen/followers","following_url":"https://api.github.com/users/MinhHNguyen/following{/other_user}","gists_url":"https://api.github.com/users/MinhHNguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/MinhHNguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinhHNguyen/subscriptions","organizations_url":"https://api.github.com/users/MinhHNguyen/orgs","repos_url":"https://api.github.com/users/MinhHNguyen/repos","events_url":"https://api.github.com/users/MinhHNguyen/events{/privacy}","received_events_url":"https://api.github.com/users/MinhHNguyen/received_events","type":"User","site_admin":false},"repo":{"id":97076353,"name":"box-content-preview","full_name":"MinhHNguyen/box-content-preview","owner":{"login":"MinhHNguyen","id":4149877,"avatar_url":"https://avatars3.githubusercontent.com/u/4149877?v=4","gravatar_id":"","url":"https://api.github.com/users/MinhHNguyen","html_url":"https://github.com/MinhHNguyen","followers_url":"https://api.github.com/users/MinhHNguyen/followers","following_url":"https://api.github.com/users/MinhHNguyen/following{/other_user}","gists_url":"https://api.github.com/users/MinhHNguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/MinhHNguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinhHNguyen/subscriptions","organizations_url":"https://api.github.com/users/MinhHNguyen/orgs","repos_url":"https://api.github.com/users/MinhHNguyen/repos","events_url":"https://api.github.com/users/MinhHNguyen/events{/privacy}","received_events_url":"https://api.github.com/users/MinhHNguyen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MinhHNguyen/box-content-preview","description":"JavaScript library for rendering files stored on Box","fork":true,"url":"https://api.github.com/repos/MinhHNguyen/box-content-preview","forks_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/forks","keys_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/teams","hooks_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/hooks","issue_events_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/issues/events{/number}","events_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/events","assignees_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/assignees{/user}","branches_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/branches{/branch}","tags_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/tags","blobs_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/git/refs{/sha}","trees_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/statuses/{sha}","languages_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/languages","stargazers_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/stargazers","contributors_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/contributors","subscribers_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/subscribers","subscription_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/subscription","commits_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/commits{/sha}","git_commits_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/git/commits{/sha}","comments_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/comments{/number}","issue_comment_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/issues/comments{/number}","contents_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/contents/{+path}","compare_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/merges","archive_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/downloads","issues_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/issues{/number}","pulls_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/pulls{/number}","milestones_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/milestones{/number}","notifications_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/labels{/name}","releases_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/releases{/id}","deployments_url":"https://api.github.com/repos/MinhHNguyen/box-content-preview/deployments","created_at":"2017-07-13T03:31:12Z","updated_at":"2017-07-13T03:31:14Z","pushed_at":"2017-08-04T04:06:38Z","git_url":"git://github.com/MinhHNguyen/box-content-preview.git","ssh_url":"git@github.com:MinhHNguyen/box-content-preview.git","clone_url":"https://github.com/MinhHNguyen/box-content-preview.git","svn_url":"https://github.com/MinhHNguyen/box-content-preview","homepage":"https://developer.box.com/docs/box-content-preview","size":29010,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"box:master","ref":"master","sha":"6f319f65afab1021f86c9f8fb820ba8ed7f01eb3","user":{"login":"box","id":23900,"avatar_url":"https://avatars0.githubusercontent.com/u/23900?v=4","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":84243617,"name":"box-content-preview","full_name":"box/box-content-preview","owner":{"login":"box","id":23900,"avatar_url":"https://avatars0.githubusercontent.com/u/23900?v=4","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/box-content-preview","description":"JavaScript library for rendering files stored on Box","fork":false,"url":"https://api.github.com/repos/box/box-content-preview","forks_url":"https://api.github.com/repos/box/box-content-preview/forks","keys_url":"https://api.github.com/repos/box/box-content-preview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/box-content-preview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/box-content-preview/teams","hooks_url":"https://api.github.com/repos/box/box-content-preview/hooks","issue_events_url":"https://api.github.com/repos/box/box-content-preview/issues/events{/number}","events_url":"https://api.github.com/repos/box/box-content-preview/events","assignees_url":"https://api.github.com/repos/box/box-content-preview/assignees{/user}","branches_url":"https://api.github.com/repos/box/box-content-preview/branches{/branch}","tags_url":"https://api.github.com/repos/box/box-content-preview/tags","blobs_url":"https://api.github.com/repos/box/box-content-preview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/box-content-preview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/box-content-preview/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/box-content-preview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/box-content-preview/statuses/{sha}","languages_url":"https://api.github.com/repos/box/box-content-preview/languages","stargazers_url":"https://api.github.com/repos/box/box-content-preview/stargazers","contributors_url":"https://api.github.com/repos/box/box-content-preview/contributors","subscribers_url":"https://api.github.com/repos/box/box-content-preview/subscribers","subscription_url":"https://api.github.com/repos/box/box-content-preview/subscription","commits_url":"https://api.github.com/repos/box/box-content-preview/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/box-content-preview/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/box-content-preview/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/box-content-preview/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/box-content-preview/contents/{+path}","compare_url":"https://api.github.com/repos/box/box-content-preview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/box-content-preview/merges","archive_url":"https://api.github.com/repos/box/box-content-preview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/box-content-preview/downloads","issues_url":"https://api.github.com/repos/box/box-content-preview/issues{/number}","pulls_url":"https://api.github.com/repos/box/box-content-preview/pulls{/number}","milestones_url":"https://api.github.com/repos/box/box-content-preview/milestones{/number}","notifications_url":"https://api.github.com/repos/box/box-content-preview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/box-content-preview/labels{/name}","releases_url":"https://api.github.com/repos/box/box-content-preview/releases{/id}","deployments_url":"https://api.github.com/repos/box/box-content-preview/deployments","created_at":"2017-03-07T20:36:24Z","updated_at":"2017-08-02T22:54:20Z","pushed_at":"2017-08-04T04:06:39Z","git_url":"git://github.com/box/box-content-preview.git","ssh_url":"git@github.com:box/box-content-preview.git","clone_url":"https://github.com/box/box-content-preview.git","svn_url":"https://github.com/box/box-content-preview","homepage":"https://developer.box.com/docs/box-content-preview","size":28953,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":7,"forks":13,"open_issues":7,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/box/box-content-preview/pulls/267"},"html":{"href":"https://github.com/box/box-content-preview/pull/267"},"issue":{"href":"https://api.github.com/repos/box/box-content-preview/issues/267"},"comments":{"href":"https://api.github.com/repos/box/box-content-preview/issues/267/comments"},"review_comments":{"href":"https://api.github.com/repos/box/box-content-preview/pulls/267/comments"},"review_comment":{"href":"https://api.github.com/repos/box/box-content-preview/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/box/box-content-preview/pulls/267/commits"},"statuses":{"href":"https://api.github.com/repos/box/box-content-preview/statuses/18f0444b5bcba7b79d383ed9cd13f2fec37ff5ce"}}}}
{"actor":{"display_login":"pramodsum"}}