{"action":"created","comment":{"url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/comments/131523849","pull_request_review_id":54517128,"id":131523849,"diff_hunk":"@@ -1993,8 +1993,11 @@ bool display::set_zoom(unsigned int amount, const bool validate_value_and_set_in\n \n \tconst SDL_Rect& area = map_area();\n \n-\txpos_ += (xpos_ + area.w / 2) * amount / zoom_;\n-\typos_ += (ypos_ + area.h / 2) * amount / zoom_;\n+\t//Turn the zoom factor to a double in order to avoid rounding errors.\n+\tdouble zoom_factor = double(new_zoom) / double(zoom_);\n+\t\n+\txpos_ = round_double( ((xpos_ + area.w / 2) * zoom_factor) - (area.w / 2) );\n+\typos_ = round_double( ((ypos_ + area.h / 2) * zoom_factor) - (area.h / 2) );","path":"src/display.cpp","position":10,"original_position":10,"commit_id":"a10a0e4ee22f58284e7d5b1f5f05eb6f9720599b","original_commit_id":"a10a0e4ee22f58284e7d5b1f5f05eb6f9720599b","user":{"login":"jyrkive","id":1665617,"avatar_url":"https://avatars1.githubusercontent.com/u/1665617?v=4","gravatar_id":"","url":"https://api.github.com/users/jyrkive","html_url":"https://github.com/jyrkive","followers_url":"https://api.github.com/users/jyrkive/followers","following_url":"https://api.github.com/users/jyrkive/following{/other_user}","gists_url":"https://api.github.com/users/jyrkive/gists{/gist_id}","starred_url":"https://api.github.com/users/jyrkive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyrkive/subscriptions","organizations_url":"https://api.github.com/users/jyrkive/orgs","repos_url":"https://api.github.com/users/jyrkive/repos","events_url":"https://api.github.com/users/jyrkive/events{/privacy}","received_events_url":"https://api.github.com/users/jyrkive/received_events","type":"User","site_admin":false},"body":"Please remove the spaces around function parameters:\r\n\r\n```\r\nxpos_ = round_double(((xpos_ + area.w / 2) * zoom_factor) - (area.w / 2));\r\n```","created_at":"2017-08-05T15:19:48Z","updated_at":"2017-08-05T15:25:45Z","html_url":"https://github.com/wesnoth/wesnoth/pull/1879#discussion_r131523849","pull_request_url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879","_links":{"self":{"href":"https://api.github.com/repos/wesnoth/wesnoth/pulls/comments/131523849"},"html":{"href":"https://github.com/wesnoth/wesnoth/pull/1879#discussion_r131523849"},"pull_request":{"href":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879"}}},"pull_request":{"url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879","id":134263571,"html_url":"https://github.com/wesnoth/wesnoth/pull/1879","diff_url":"https://github.com/wesnoth/wesnoth/pull/1879.diff","patch_url":"https://github.com/wesnoth/wesnoth/pull/1879.patch","issue_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/1879","number":1879,"state":"open","locked":false,"title":"Center viewport on zoom","user":{"login":"DisherProject","id":29802612,"avatar_url":"https://avatars0.githubusercontent.com/u/29802612?v=4","gravatar_id":"","url":"https://api.github.com/users/DisherProject","html_url":"https://github.com/DisherProject","followers_url":"https://api.github.com/users/DisherProject/followers","following_url":"https://api.github.com/users/DisherProject/following{/other_user}","gists_url":"https://api.github.com/users/DisherProject/gists{/gist_id}","starred_url":"https://api.github.com/users/DisherProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DisherProject/subscriptions","organizations_url":"https://api.github.com/users/DisherProject/orgs","repos_url":"https://api.github.com/users/DisherProject/repos","events_url":"https://api.github.com/users/DisherProject/events{/privacy}","received_events_url":"https://api.github.com/users/DisherProject/received_events","type":"User","site_admin":false},"body":"This should fix issue [#1845](https://github.com/wesnoth/wesnoth/issues/1845).","created_at":"2017-08-04T22:43:28Z","updated_at":"2017-08-05T15:25:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f9e75ecd01ff4aebab671474867f7f64129c1bc","assignee":{"login":"jyrkive","id":1665617,"avatar_url":"https://avatars1.githubusercontent.com/u/1665617?v=4","gravatar_id":"","url":"https://api.github.com/users/jyrkive","html_url":"https://github.com/jyrkive","followers_url":"https://api.github.com/users/jyrkive/followers","following_url":"https://api.github.com/users/jyrkive/following{/other_user}","gists_url":"https://api.github.com/users/jyrkive/gists{/gist_id}","starred_url":"https://api.github.com/users/jyrkive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyrkive/subscriptions","organizations_url":"https://api.github.com/users/jyrkive/orgs","repos_url":"https://api.github.com/users/jyrkive/repos","events_url":"https://api.github.com/users/jyrkive/events{/privacy}","received_events_url":"https://api.github.com/users/jyrkive/received_events","type":"User","site_admin":false},"assignees":[{"login":"jyrkive","id":1665617,"avatar_url":"https://avatars1.githubusercontent.com/u/1665617?v=4","gravatar_id":"","url":"https://api.github.com/users/jyrkive","html_url":"https://github.com/jyrkive","followers_url":"https://api.github.com/users/jyrkive/followers","following_url":"https://api.github.com/users/jyrkive/following{/other_user}","gists_url":"https://api.github.com/users/jyrkive/gists{/gist_id}","starred_url":"https://api.github.com/users/jyrkive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyrkive/subscriptions","organizations_url":"https://api.github.com/users/jyrkive/orgs","repos_url":"https://api.github.com/users/jyrkive/repos","events_url":"https://api.github.com/users/jyrkive/events{/privacy}","received_events_url":"https://api.github.com/users/jyrkive/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879/commits","review_comments_url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879/comments","review_comment_url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/1879/comments","statuses_url":"https://api.github.com/repos/wesnoth/wesnoth/statuses/a10a0e4ee22f58284e7d5b1f5f05eb6f9720599b","head":{"label":"DisherProject:master","ref":"master","sha":"a10a0e4ee22f58284e7d5b1f5f05eb6f9720599b","user":{"login":"DisherProject","id":29802612,"avatar_url":"https://avatars0.githubusercontent.com/u/29802612?v=4","gravatar_id":"","url":"https://api.github.com/users/DisherProject","html_url":"https://github.com/DisherProject","followers_url":"https://api.github.com/users/DisherProject/followers","following_url":"https://api.github.com/users/DisherProject/following{/other_user}","gists_url":"https://api.github.com/users/DisherProject/gists{/gist_id}","starred_url":"https://api.github.com/users/DisherProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DisherProject/subscriptions","organizations_url":"https://api.github.com/users/DisherProject/orgs","repos_url":"https://api.github.com/users/DisherProject/repos","events_url":"https://api.github.com/users/DisherProject/events{/privacy}","received_events_url":"https://api.github.com/users/DisherProject/received_events","type":"User","site_admin":false},"repo":{"id":95978902,"name":"wesnoth","full_name":"DisherProject/wesnoth","owner":{"login":"DisherProject","id":29802612,"avatar_url":"https://avatars0.githubusercontent.com/u/29802612?v=4","gravatar_id":"","url":"https://api.github.com/users/DisherProject","html_url":"https://github.com/DisherProject","followers_url":"https://api.github.com/users/DisherProject/followers","following_url":"https://api.github.com/users/DisherProject/following{/other_user}","gists_url":"https://api.github.com/users/DisherProject/gists{/gist_id}","starred_url":"https://api.github.com/users/DisherProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DisherProject/subscriptions","organizations_url":"https://api.github.com/users/DisherProject/orgs","repos_url":"https://api.github.com/users/DisherProject/repos","events_url":"https://api.github.com/users/DisherProject/events{/privacy}","received_events_url":"https://api.github.com/users/DisherProject/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DisherProject/wesnoth","description":"Free, turn-based strategy game with a high fantasy theme, featuring both singleplayer and online/hotseat multiplayer combat.","fork":true,"url":"https://api.github.com/repos/DisherProject/wesnoth","forks_url":"https://api.github.com/repos/DisherProject/wesnoth/forks","keys_url":"https://api.github.com/repos/DisherProject/wesnoth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DisherProject/wesnoth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DisherProject/wesnoth/teams","hooks_url":"https://api.github.com/repos/DisherProject/wesnoth/hooks","issue_events_url":"https://api.github.com/repos/DisherProject/wesnoth/issues/events{/number}","events_url":"https://api.github.com/repos/DisherProject/wesnoth/events","assignees_url":"https://api.github.com/repos/DisherProject/wesnoth/assignees{/user}","branches_url":"https://api.github.com/repos/DisherProject/wesnoth/branches{/branch}","tags_url":"https://api.github.com/repos/DisherProject/wesnoth/tags","blobs_url":"https://api.github.com/repos/DisherProject/wesnoth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DisherProject/wesnoth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DisherProject/wesnoth/git/refs{/sha}","trees_url":"https://api.github.com/repos/DisherProject/wesnoth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DisherProject/wesnoth/statuses/{sha}","languages_url":"https://api.github.com/repos/DisherProject/wesnoth/languages","stargazers_url":"https://api.github.com/repos/DisherProject/wesnoth/stargazers","contributors_url":"https://api.github.com/repos/DisherProject/wesnoth/contributors","subscribers_url":"https://api.github.com/repos/DisherProject/wesnoth/subscribers","subscription_url":"https://api.github.com/repos/DisherProject/wesnoth/subscription","commits_url":"https://api.github.com/repos/DisherProject/wesnoth/commits{/sha}","git_commits_url":"https://api.github.com/repos/DisherProject/wesnoth/git/commits{/sha}","comments_url":"https://api.github.com/repos/DisherProject/wesnoth/comments{/number}","issue_comment_url":"https://api.github.com/repos/DisherProject/wesnoth/issues/comments{/number}","contents_url":"https://api.github.com/repos/DisherProject/wesnoth/contents/{+path}","compare_url":"https://api.github.com/repos/DisherProject/wesnoth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DisherProject/wesnoth/merges","archive_url":"https://api.github.com/repos/DisherProject/wesnoth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DisherProject/wesnoth/downloads","issues_url":"https://api.github.com/repos/DisherProject/wesnoth/issues{/number}","pulls_url":"https://api.github.com/repos/DisherProject/wesnoth/pulls{/number}","milestones_url":"https://api.github.com/repos/DisherProject/wesnoth/milestones{/number}","notifications_url":"https://api.github.com/repos/DisherProject/wesnoth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DisherProject/wesnoth/labels{/name}","releases_url":"https://api.github.com/repos/DisherProject/wesnoth/releases{/id}","deployments_url":"https://api.github.com/repos/DisherProject/wesnoth/deployments","created_at":"2017-07-01T17:38:38Z","updated_at":"2017-07-01T17:39:15Z","pushed_at":"2017-08-04T22:36:44Z","git_url":"git://github.com/DisherProject/wesnoth.git","ssh_url":"git@github.com:DisherProject/wesnoth.git","clone_url":"https://github.com/DisherProject/wesnoth.git","svn_url":"https://github.com/DisherProject/wesnoth","homepage":"http://www.wesnoth.org/","size":2524778,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"wesnoth:master","ref":"master","sha":"98648ddf636bf4725d17334addac57850c478315","user":{"login":"wesnoth","id":4024232,"avatar_url":"https://avatars2.githubusercontent.com/u/4024232?v=4","gravatar_id":"","url":"https://api.github.com/users/wesnoth","html_url":"https://github.com/wesnoth","followers_url":"https://api.github.com/users/wesnoth/followers","following_url":"https://api.github.com/users/wesnoth/following{/other_user}","gists_url":"https://api.github.com/users/wesnoth/gists{/gist_id}","starred_url":"https://api.github.com/users/wesnoth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesnoth/subscriptions","organizations_url":"https://api.github.com/users/wesnoth/orgs","repos_url":"https://api.github.com/users/wesnoth/repos","events_url":"https://api.github.com/users/wesnoth/events{/privacy}","received_events_url":"https://api.github.com/users/wesnoth/received_events","type":"Organization","site_admin":false},"repo":{"id":9432220,"name":"wesnoth","full_name":"wesnoth/wesnoth","owner":{"login":"wesnoth","id":4024232,"avatar_url":"https://avatars2.githubusercontent.com/u/4024232?v=4","gravatar_id":"","url":"https://api.github.com/users/wesnoth","html_url":"https://github.com/wesnoth","followers_url":"https://api.github.com/users/wesnoth/followers","following_url":"https://api.github.com/users/wesnoth/following{/other_user}","gists_url":"https://api.github.com/users/wesnoth/gists{/gist_id}","starred_url":"https://api.github.com/users/wesnoth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesnoth/subscriptions","organizations_url":"https://api.github.com/users/wesnoth/orgs","repos_url":"https://api.github.com/users/wesnoth/repos","events_url":"https://api.github.com/users/wesnoth/events{/privacy}","received_events_url":"https://api.github.com/users/wesnoth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wesnoth/wesnoth","description":"Free, turn-based strategy game with a high fantasy theme, featuring both singleplayer and online/hotseat multiplayer combat.","fork":false,"url":"https://api.github.com/repos/wesnoth/wesnoth","forks_url":"https://api.github.com/repos/wesnoth/wesnoth/forks","keys_url":"https://api.github.com/repos/wesnoth/wesnoth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wesnoth/wesnoth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wesnoth/wesnoth/teams","hooks_url":"https://api.github.com/repos/wesnoth/wesnoth/hooks","issue_events_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/events{/number}","events_url":"https://api.github.com/repos/wesnoth/wesnoth/events","assignees_url":"https://api.github.com/repos/wesnoth/wesnoth/assignees{/user}","branches_url":"https://api.github.com/repos/wesnoth/wesnoth/branches{/branch}","tags_url":"https://api.github.com/repos/wesnoth/wesnoth/tags","blobs_url":"https://api.github.com/repos/wesnoth/wesnoth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wesnoth/wesnoth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wesnoth/wesnoth/git/refs{/sha}","trees_url":"https://api.github.com/repos/wesnoth/wesnoth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wesnoth/wesnoth/statuses/{sha}","languages_url":"https://api.github.com/repos/wesnoth/wesnoth/languages","stargazers_url":"https://api.github.com/repos/wesnoth/wesnoth/stargazers","contributors_url":"https://api.github.com/repos/wesnoth/wesnoth/contributors","subscribers_url":"https://api.github.com/repos/wesnoth/wesnoth/subscribers","subscription_url":"https://api.github.com/repos/wesnoth/wesnoth/subscription","commits_url":"https://api.github.com/repos/wesnoth/wesnoth/commits{/sha}","git_commits_url":"https://api.github.com/repos/wesnoth/wesnoth/git/commits{/sha}","comments_url":"https://api.github.com/repos/wesnoth/wesnoth/comments{/number}","issue_comment_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/comments{/number}","contents_url":"https://api.github.com/repos/wesnoth/wesnoth/contents/{+path}","compare_url":"https://api.github.com/repos/wesnoth/wesnoth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wesnoth/wesnoth/merges","archive_url":"https://api.github.com/repos/wesnoth/wesnoth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wesnoth/wesnoth/downloads","issues_url":"https://api.github.com/repos/wesnoth/wesnoth/issues{/number}","pulls_url":"https://api.github.com/repos/wesnoth/wesnoth/pulls{/number}","milestones_url":"https://api.github.com/repos/wesnoth/wesnoth/milestones{/number}","notifications_url":"https://api.github.com/repos/wesnoth/wesnoth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wesnoth/wesnoth/labels{/name}","releases_url":"https://api.github.com/repos/wesnoth/wesnoth/releases{/id}","deployments_url":"https://api.github.com/repos/wesnoth/wesnoth/deployments","created_at":"2013-04-14T17:13:06Z","updated_at":"2017-08-05T07:10:56Z","pushed_at":"2017-08-05T15:04:12Z","git_url":"git://github.com/wesnoth/wesnoth.git","ssh_url":"git@github.com:wesnoth/wesnoth.git","clone_url":"https://github.com/wesnoth/wesnoth.git","svn_url":"https://github.com/wesnoth/wesnoth","homepage":"http://www.wesnoth.org/","size":2525016,"stargazers_count":1144,"watchers_count":1144,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":372,"mirror_url":null,"open_issues_count":649,"forks":372,"open_issues":649,"watchers":1144,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879"},"html":{"href":"https://github.com/wesnoth/wesnoth/pull/1879"},"issue":{"href":"https://api.github.com/repos/wesnoth/wesnoth/issues/1879"},"comments":{"href":"https://api.github.com/repos/wesnoth/wesnoth/issues/1879/comments"},"review_comments":{"href":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879/comments"},"review_comment":{"href":"https://api.github.com/repos/wesnoth/wesnoth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wesnoth/wesnoth/pulls/1879/commits"},"statuses":{"href":"https://api.github.com/repos/wesnoth/wesnoth/statuses/a10a0e4ee22f58284e7d5b1f5f05eb6f9720599b"}}}}
{"actor":{"display_login":"jyrkive"}}