{"action":"created","comment":{"url":"https://api.github.com/repos/uber/deck.gl/pulls/comments/103604256","pull_request_review_id":24394092,"id":103604256,"diff_hunk":"@@ -87,27 +87,53 @@ export function pickLayers(gl, {\n     });\n \n     // Read color in the central pixel, to be mapped with picking colors\n-    const color = new Uint8Array(4);\n-    gl.readPixels(deviceX, deviceY, 1, 1, GL.RGBA, GL.UNSIGNED_BYTE, color);\n+    const pickedColor = new Uint8Array(4);\n+    gl.readPixels(deviceX, deviceY, 1, 1, GL.RGBA, GL.UNSIGNED_BYTE, pickedColor);\n \n     // restore blend mode\n     setBlendMode(gl, oldBlendMode);\n     // Picking process end\n \n     // Process picked info start\n     // Decode alpha to layer index\n-    const pickedLayer = layers[color[3] - 1];\n+    const pickedLayer = pickedColor[3] ? layers[pickedColor[3] - 1] : null;\n+    const affectedLayers = [pickedLayer];\n+\n+    if (mode === 'hover') {\n+      // only invoke onHover events if picked object has changed\n+      const {lastPickedColor, lastPickedLayerId} = context;\n+\n+      const pickedLayerChanged = (pickedLayer && pickedLayer.props.id) !== lastPickedLayerId;","path":"src/lib/draw-and-pick.js","position":55,"original_position":55,"commit_id":"85473cb1b44083dc03d5ecd9ae1f30fc0ba6c813","original_commit_id":"85473cb1b44083dc03d5ecd9ae1f30fc0ba6c813","user":{"login":"ibgreen","id":7025232,"avatar_url":"https://avatars2.githubusercontent.com/u/7025232?v=3","gravatar_id":"","url":"https://api.github.com/users/ibgreen","html_url":"https://github.com/ibgreen","followers_url":"https://api.github.com/users/ibgreen/followers","following_url":"https://api.github.com/users/ibgreen/following{/other_user}","gists_url":"https://api.github.com/users/ibgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/ibgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibgreen/subscriptions","organizations_url":"https://api.github.com/users/ibgreen/orgs","repos_url":"https://api.github.com/users/ibgreen/repos","events_url":"https://api.github.com/users/ibgreen/events{/privacy}","received_events_url":"https://api.github.com/users/ibgreen/received_events","type":"User","site_admin":false},"body":"Again maybe split in two lines to make more self documenting?\r\n```\r\nconst pickedLayerId = pickedLayer && pickedLayer.props.id;\r\n...\r\n```","created_at":"2017-03-01T03:26:39Z","updated_at":"2017-03-01T03:46:05Z","html_url":"https://github.com/uber/deck.gl/pull/384#discussion_r103604256","pull_request_url":"https://api.github.com/repos/uber/deck.gl/pulls/384","_links":{"self":{"href":"https://api.github.com/repos/uber/deck.gl/pulls/comments/103604256"},"html":{"href":"https://github.com/uber/deck.gl/pull/384#discussion_r103604256"},"pull_request":{"href":"https://api.github.com/repos/uber/deck.gl/pulls/384"}}},"pull_request":{"url":"https://api.github.com/repos/uber/deck.gl/pulls/384","id":108458004,"html_url":"https://github.com/uber/deck.gl/pull/384","diff_url":"https://github.com/uber/deck.gl/pull/384.diff","patch_url":"https://github.com/uber/deck.gl/pull/384.patch","issue_url":"https://api.github.com/repos/uber/deck.gl/issues/384","number":384,"state":"open","locked":false,"title":"Only invoke mouse event on affected layers","user":{"login":"Pessimistress","id":2059298,"avatar_url":"https://avatars1.githubusercontent.com/u/2059298?v=3","gravatar_id":"","url":"https://api.github.com/users/Pessimistress","html_url":"https://github.com/Pessimistress","followers_url":"https://api.github.com/users/Pessimistress/followers","following_url":"https://api.github.com/users/Pessimistress/following{/other_user}","gists_url":"https://api.github.com/users/Pessimistress/gists{/gist_id}","starred_url":"https://api.github.com/users/Pessimistress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pessimistress/subscriptions","organizations_url":"https://api.github.com/users/Pessimistress/orgs","repos_url":"https://api.github.com/users/Pessimistress/repos","events_url":"https://api.github.com/users/Pessimistress/events{/privacy}","received_events_url":"https://api.github.com/users/Pessimistress/received_events","type":"User","site_admin":false},"body":"- `onHover` is only called upon enter/leave\r\n- `onClick` is only called on the picked layer","created_at":"2017-03-01T02:59:12Z","updated_at":"2017-03-01T03:46:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf8b71d7705f1d907812f5cd00821b1adaa2dc0f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uber/deck.gl/pulls/384/commits","review_comments_url":"https://api.github.com/repos/uber/deck.gl/pulls/384/comments","review_comment_url":"https://api.github.com/repos/uber/deck.gl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/deck.gl/issues/384/comments","statuses_url":"https://api.github.com/repos/uber/deck.gl/statuses/85473cb1b44083dc03d5ecd9ae1f30fc0ba6c813","head":{"label":"uber:picking","ref":"picking","sha":"85473cb1b44083dc03d5ecd9ae1f30fc0ba6c813","user":{"login":"uber","id":538264,"avatar_url":"https://avatars0.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":48030204,"name":"deck.gl","full_name":"uber/deck.gl","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars0.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/deck.gl","description":"WebGL based visualization layers","fork":false,"url":"https://api.github.com/repos/uber/deck.gl","forks_url":"https://api.github.com/repos/uber/deck.gl/forks","keys_url":"https://api.github.com/repos/uber/deck.gl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/deck.gl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/deck.gl/teams","hooks_url":"https://api.github.com/repos/uber/deck.gl/hooks","issue_events_url":"https://api.github.com/repos/uber/deck.gl/issues/events{/number}","events_url":"https://api.github.com/repos/uber/deck.gl/events","assignees_url":"https://api.github.com/repos/uber/deck.gl/assignees{/user}","branches_url":"https://api.github.com/repos/uber/deck.gl/branches{/branch}","tags_url":"https://api.github.com/repos/uber/deck.gl/tags","blobs_url":"https://api.github.com/repos/uber/deck.gl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/deck.gl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/deck.gl/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/deck.gl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/deck.gl/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/deck.gl/languages","stargazers_url":"https://api.github.com/repos/uber/deck.gl/stargazers","contributors_url":"https://api.github.com/repos/uber/deck.gl/contributors","subscribers_url":"https://api.github.com/repos/uber/deck.gl/subscribers","subscription_url":"https://api.github.com/repos/uber/deck.gl/subscription","commits_url":"https://api.github.com/repos/uber/deck.gl/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/deck.gl/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/deck.gl/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/deck.gl/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/deck.gl/contents/{+path}","compare_url":"https://api.github.com/repos/uber/deck.gl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/deck.gl/merges","archive_url":"https://api.github.com/repos/uber/deck.gl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/deck.gl/downloads","issues_url":"https://api.github.com/repos/uber/deck.gl/issues{/number}","pulls_url":"https://api.github.com/repos/uber/deck.gl/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/deck.gl/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/deck.gl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/deck.gl/labels{/name}","releases_url":"https://api.github.com/repos/uber/deck.gl/releases{/id}","deployments_url":"https://api.github.com/repos/uber/deck.gl/deployments","created_at":"2015-12-15T08:38:29Z","updated_at":"2017-03-01T02:58:25Z","pushed_at":"2017-03-01T02:59:12Z","git_url":"git://github.com/uber/deck.gl.git","ssh_url":"git@github.com:uber/deck.gl.git","clone_url":"https://github.com/uber/deck.gl.git","svn_url":"https://github.com/uber/deck.gl","homepage":"http://uber.github.io/deck.gl","size":37518,"stargazers_count":1758,"watchers_count":1758,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":139,"mirror_url":null,"open_issues_count":17,"forks":139,"open_issues":17,"watchers":1758,"default_branch":"master"}},"base":{"label":"uber:dev","ref":"dev","sha":"4a9f9c410efa518095b421aef5b2fd4eca8b0515","user":{"login":"uber","id":538264,"avatar_url":"https://avatars0.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":48030204,"name":"deck.gl","full_name":"uber/deck.gl","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars0.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/deck.gl","description":"WebGL based visualization layers","fork":false,"url":"https://api.github.com/repos/uber/deck.gl","forks_url":"https://api.github.com/repos/uber/deck.gl/forks","keys_url":"https://api.github.com/repos/uber/deck.gl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/deck.gl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/deck.gl/teams","hooks_url":"https://api.github.com/repos/uber/deck.gl/hooks","issue_events_url":"https://api.github.com/repos/uber/deck.gl/issues/events{/number}","events_url":"https://api.github.com/repos/uber/deck.gl/events","assignees_url":"https://api.github.com/repos/uber/deck.gl/assignees{/user}","branches_url":"https://api.github.com/repos/uber/deck.gl/branches{/branch}","tags_url":"https://api.github.com/repos/uber/deck.gl/tags","blobs_url":"https://api.github.com/repos/uber/deck.gl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/deck.gl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/deck.gl/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/deck.gl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/deck.gl/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/deck.gl/languages","stargazers_url":"https://api.github.com/repos/uber/deck.gl/stargazers","contributors_url":"https://api.github.com/repos/uber/deck.gl/contributors","subscribers_url":"https://api.github.com/repos/uber/deck.gl/subscribers","subscription_url":"https://api.github.com/repos/uber/deck.gl/subscription","commits_url":"https://api.github.com/repos/uber/deck.gl/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/deck.gl/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/deck.gl/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/deck.gl/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/deck.gl/contents/{+path}","compare_url":"https://api.github.com/repos/uber/deck.gl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/deck.gl/merges","archive_url":"https://api.github.com/repos/uber/deck.gl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/deck.gl/downloads","issues_url":"https://api.github.com/repos/uber/deck.gl/issues{/number}","pulls_url":"https://api.github.com/repos/uber/deck.gl/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/deck.gl/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/deck.gl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/deck.gl/labels{/name}","releases_url":"https://api.github.com/repos/uber/deck.gl/releases{/id}","deployments_url":"https://api.github.com/repos/uber/deck.gl/deployments","created_at":"2015-12-15T08:38:29Z","updated_at":"2017-03-01T02:58:25Z","pushed_at":"2017-03-01T02:59:12Z","git_url":"git://github.com/uber/deck.gl.git","ssh_url":"git@github.com:uber/deck.gl.git","clone_url":"https://github.com/uber/deck.gl.git","svn_url":"https://github.com/uber/deck.gl","homepage":"http://uber.github.io/deck.gl","size":37518,"stargazers_count":1758,"watchers_count":1758,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":139,"mirror_url":null,"open_issues_count":17,"forks":139,"open_issues":17,"watchers":1758,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/deck.gl/pulls/384"},"html":{"href":"https://github.com/uber/deck.gl/pull/384"},"issue":{"href":"https://api.github.com/repos/uber/deck.gl/issues/384"},"comments":{"href":"https://api.github.com/repos/uber/deck.gl/issues/384/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/deck.gl/pulls/384/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/deck.gl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/deck.gl/pulls/384/commits"},"statuses":{"href":"https://api.github.com/repos/uber/deck.gl/statuses/85473cb1b44083dc03d5ecd9ae1f30fc0ba6c813"}}}}
{"actor":{"display_login":"ibgreen"}}