{"action":"created","comment":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/comments/39768668","id":39768668,"diff_hunk":"@@ -7643,9 +7643,8 @@ void QgisApp::legendLayerZoomNative()\n       QgsCoordinateTransform ct( mMapCanvas->mapSettings().destinationCrs(), layer->crs() );\n       p1 = ct.transform( p1 );\n       p2 = ct.transform( p2 );\n-      double width = sqrt( p1.sqrDist( p2 ) ); // width of reprojected pixel\n-      // This is not perfect of course, we use the resolution in just one direction\n-      mMapCanvas->zoomByFactor( qAbs( layer->rasterUnitsPerPixelX() / width ) );\n+      double width = sqrt( p1.sqrDist( p2 ) ); // width (actually the diagonal) of reprojected pixel","path":"src/app/qgisapp.cpp","position":16,"original_position":16,"commit_id":"4c8c7454f34b7bca3a12b74f7699f5d167c01068","original_commit_id":"4c8c7454f34b7bca3a12b74f7699f5d167c01068","user":{"login":"vmora","id":4415710,"avatar_url":"https://avatars.githubusercontent.com/u/4415710?v=3","gravatar_id":"","url":"https://api.github.com/users/vmora","html_url":"https://github.com/vmora","followers_url":"https://api.github.com/users/vmora/followers","following_url":"https://api.github.com/users/vmora/following{/other_user}","gists_url":"https://api.github.com/users/vmora/gists{/gist_id}","starred_url":"https://api.github.com/users/vmora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmora/subscriptions","organizations_url":"https://api.github.com/users/vmora/orgs","repos_url":"https://api.github.com/users/vmora/repos","events_url":"https://api.github.com/users/vmora/events{/privacy}","received_events_url":"https://api.github.com/users/vmora/received_events","type":"User","site_admin":false},"body":"What about: \r\n    const double diagonalLengthOfReprojectedPixel = sqrt( p1.sqrDist( p2 ) );\r\nand leaving out the comment ?","created_at":"2015-09-17T16:44:10Z","updated_at":"2015-09-17T16:44:10Z","html_url":"https://github.com/qgis/QGIS/pull/2314#discussion_r39768668","pull_request_url":"https://api.github.com/repos/qgis/QGIS/pulls/2314","_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments/39768668"},"html":{"href":"https://github.com/qgis/QGIS/pull/2314#discussion_r39768668"},"pull_request":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2314"}}},"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/2314","id":45071198,"html_url":"https://github.com/qgis/QGIS/pull/2314","diff_url":"https://github.com/qgis/QGIS/pull/2314.diff","patch_url":"https://github.com/qgis/QGIS/pull/2314.patch","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/2314","number":2314,"state":"open","locked":false,"title":"Fix 3609 - legendLayerZoomNative zooms to correct scale","user":{"login":"stevenmizuno","id":14251800,"avatar_url":"https://avatars.githubusercontent.com/u/14251800?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenmizuno","html_url":"https://github.com/stevenmizuno","followers_url":"https://api.github.com/users/stevenmizuno/followers","following_url":"https://api.github.com/users/stevenmizuno/following{/other_user}","gists_url":"https://api.github.com/users/stevenmizuno/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenmizuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenmizuno/subscriptions","organizations_url":"https://api.github.com/users/stevenmizuno/orgs","repos_url":"https://api.github.com/users/stevenmizuno/repos","events_url":"https://api.github.com/users/stevenmizuno/events{/privacy}","received_events_url":"https://api.github.com/users/stevenmizuno/received_events","type":"User","site_admin":false},"body":"This uses the pixel diagonal distance for the source raster to match the diagonal of the mapCanvas  with OTF","created_at":"2015-09-15T16:26:39Z","updated_at":"2015-09-17T16:44:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f24416998daaef0b416148123767214261d546c6","assignee":{"login":"wonder-sk","id":193367,"avatar_url":"https://avatars.githubusercontent.com/u/193367?v=3","gravatar_id":"","url":"https://api.github.com/users/wonder-sk","html_url":"https://github.com/wonder-sk","followers_url":"https://api.github.com/users/wonder-sk/followers","following_url":"https://api.github.com/users/wonder-sk/following{/other_user}","gists_url":"https://api.github.com/users/wonder-sk/gists{/gist_id}","starred_url":"https://api.github.com/users/wonder-sk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wonder-sk/subscriptions","organizations_url":"https://api.github.com/users/wonder-sk/orgs","repos_url":"https://api.github.com/users/wonder-sk/repos","events_url":"https://api.github.com/users/wonder-sk/events{/privacy}","received_events_url":"https://api.github.com/users/wonder-sk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/qgis/QGIS/pulls/2314/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS/pulls/2314/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/2314/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/4c8c7454f34b7bca3a12b74f7699f5d167c01068","head":{"label":"stevenmizuno:fix_3609","ref":"fix_3609","sha":"4c8c7454f34b7bca3a12b74f7699f5d167c01068","user":{"login":"stevenmizuno","id":14251800,"avatar_url":"https://avatars.githubusercontent.com/u/14251800?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenmizuno","html_url":"https://github.com/stevenmizuno","followers_url":"https://api.github.com/users/stevenmizuno/followers","following_url":"https://api.github.com/users/stevenmizuno/following{/other_user}","gists_url":"https://api.github.com/users/stevenmizuno/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenmizuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenmizuno/subscriptions","organizations_url":"https://api.github.com/users/stevenmizuno/orgs","repos_url":"https://api.github.com/users/stevenmizuno/repos","events_url":"https://api.github.com/users/stevenmizuno/events{/privacy}","received_events_url":"https://api.github.com/users/stevenmizuno/received_events","type":"User","site_admin":false},"repo":{"id":42367024,"name":"QGIS","full_name":"stevenmizuno/QGIS","owner":{"login":"stevenmizuno","id":14251800,"avatar_url":"https://avatars.githubusercontent.com/u/14251800?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenmizuno","html_url":"https://github.com/stevenmizuno","followers_url":"https://api.github.com/users/stevenmizuno/followers","following_url":"https://api.github.com/users/stevenmizuno/following{/other_user}","gists_url":"https://api.github.com/users/stevenmizuno/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenmizuno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenmizuno/subscriptions","organizations_url":"https://api.github.com/users/stevenmizuno/orgs","repos_url":"https://api.github.com/users/stevenmizuno/repos","events_url":"https://api.github.com/users/stevenmizuno/events{/privacy}","received_events_url":"https://api.github.com/users/stevenmizuno/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevenmizuno/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":true,"url":"https://api.github.com/repos/stevenmizuno/QGIS","forks_url":"https://api.github.com/repos/stevenmizuno/QGIS/forks","keys_url":"https://api.github.com/repos/stevenmizuno/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevenmizuno/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevenmizuno/QGIS/teams","hooks_url":"https://api.github.com/repos/stevenmizuno/QGIS/hooks","issue_events_url":"https://api.github.com/repos/stevenmizuno/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/stevenmizuno/QGIS/events","assignees_url":"https://api.github.com/repos/stevenmizuno/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/stevenmizuno/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/stevenmizuno/QGIS/tags","blobs_url":"https://api.github.com/repos/stevenmizuno/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevenmizuno/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevenmizuno/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevenmizuno/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevenmizuno/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/stevenmizuno/QGIS/languages","stargazers_url":"https://api.github.com/repos/stevenmizuno/QGIS/stargazers","contributors_url":"https://api.github.com/repos/stevenmizuno/QGIS/contributors","subscribers_url":"https://api.github.com/repos/stevenmizuno/QGIS/subscribers","subscription_url":"https://api.github.com/repos/stevenmizuno/QGIS/subscription","commits_url":"https://api.github.com/repos/stevenmizuno/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevenmizuno/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevenmizuno/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevenmizuno/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevenmizuno/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/stevenmizuno/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevenmizuno/QGIS/merges","archive_url":"https://api.github.com/repos/stevenmizuno/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevenmizuno/QGIS/downloads","issues_url":"https://api.github.com/repos/stevenmizuno/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/stevenmizuno/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/stevenmizuno/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/stevenmizuno/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevenmizuno/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/stevenmizuno/QGIS/releases{/id}","created_at":"2015-09-12T17:53:12Z","updated_at":"2015-09-12T17:53:35Z","pushed_at":"2015-09-17T16:17:30Z","git_url":"git://github.com/stevenmizuno/QGIS.git","ssh_url":"git@github.com:stevenmizuno/QGIS.git","clone_url":"https://github.com/stevenmizuno/QGIS.git","svn_url":"https://github.com/stevenmizuno/QGIS","homepage":"http://qgis.org","size":1144767,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"qgis:master","ref":"master","sha":"e970f4afeee4e909e6555e3c7c2720d59ef98ea7","user":{"login":"qgis","id":483444,"avatar_url":"https://avatars.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":1690480,"name":"QGIS","full_name":"qgis/QGIS","owner":{"login":"qgis","id":483444,"avatar_url":"https://avatars.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qgis/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":false,"url":"https://api.github.com/repos/qgis/QGIS","forks_url":"https://api.github.com/repos/qgis/QGIS/forks","keys_url":"https://api.github.com/repos/qgis/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS/events","assignees_url":"https://api.github.com/repos/qgis/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS/merges","archive_url":"https://api.github.com/repos/qgis/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS/releases{/id}","created_at":"2011-05-02T08:06:26Z","updated_at":"2015-09-16T13:50:25Z","pushed_at":"2015-09-17T15:36:09Z","git_url":"git://github.com/qgis/QGIS.git","ssh_url":"git@github.com:qgis/QGIS.git","clone_url":"https://github.com/qgis/QGIS.git","svn_url":"https://github.com/qgis/QGIS","homepage":"http://qgis.org","size":1233461,"stargazers_count":743,"watchers_count":743,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":686,"mirror_url":null,"open_issues_count":41,"forks":686,"open_issues":41,"watchers":743,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2314"},"html":{"href":"https://github.com/qgis/QGIS/pull/2314"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS/issues/2314"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS/issues/2314/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2314/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2314/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS/statuses/4c8c7454f34b7bca3a12b74f7699f5d167c01068"}}}}