{"action":"created","comment":{"url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/comments/91903123","pull_request_review_id":12410987,"id":91903123,"diff_hunk":"@@ -0,0 +1,53 @@\n+package com.edulectronics.tinycircuit.Controllers;\n+\n+import android.graphics.Canvas;\n+import android.graphics.Color;\n+import android.graphics.Paint;\n+import android.graphics.Point;\n+\n+import com.edulectronics.tinycircuit.Models.Components.Connectors.ConnectionPoint;\n+import com.edulectronics.tinycircuit.Models.Components.Connectors.ConnectionPointOrientation;\n+import com.edulectronics.tinycircuit.R;\n+import com.edulectronics.tinycircuit.Views.DrawView;\n+\n+/**\n+ * Created by bernd on 09/12/2016.\n+ */\n+\n+public class DrawingController {\n+\n+    private int gridWidth, cellSize;\n+\n+    public DrawingController(int gridWidth, int cellSize) {\n+        this.gridWidth = gridWidth;\n+        this.cellSize = cellSize;\n+    }\n+\n+    public Point getNodeLocation(int position, ConnectionPointOrientation orientation) {\n+        return new Point(getXLocation(position, orientation), getYLocation(position, orientation));\n+    }\n+\n+    private int getXLocation(int position, ConnectionPointOrientation orientation) {\n+        if (orientation == ConnectionPointOrientation.Top || orientation == ConnectionPointOrientation.Bottom)\n+            return (getColumn(position) - 1) * 150 + (int)(0.5 * cellSize);\n+        if (orientation == ConnectionPointOrientation.Left)\n+            return (getColumn(position) - 1) * 150;\n+        return getColumn(position) * 150;\n+    }\n+\n+    private int getYLocation(int position, ConnectionPointOrientation orientation) {\n+        if (orientation == ConnectionPointOrientation.Left || orientation == ConnectionPointOrientation.Right)\n+            return (getRow(position) - 1) * 150 + (int)(0.5 * cellSize);","path":"app/src/main/java/com/edulectronics/tinycircuit/Controllers/DrawingController.java","position":40,"original_position":40,"commit_id":"af0af5dce6300f3b71368e940cba9bad1e8fd054","original_commit_id":"af0af5dce6300f3b71368e940cba9bad1e8fd054","user":{"login":"wzwietering","id":15837844,"avatar_url":"https://avatars.githubusercontent.com/u/15837844?v=3","gravatar_id":"","url":"https://api.github.com/users/wzwietering","html_url":"https://github.com/wzwietering","followers_url":"https://api.github.com/users/wzwietering/followers","following_url":"https://api.github.com/users/wzwietering/following{/other_user}","gists_url":"https://api.github.com/users/wzwietering/gists{/gist_id}","starred_url":"https://api.github.com/users/wzwietering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzwietering/subscriptions","organizations_url":"https://api.github.com/users/wzwietering/orgs","repos_url":"https://api.github.com/users/wzwietering/repos","events_url":"https://api.github.com/users/wzwietering/events{/privacy}","received_events_url":"https://api.github.com/users/wzwietering/received_events","type":"User","site_admin":false},"body":"SPATIE","created_at":"2016-12-12T08:46:42Z","updated_at":"2016-12-12T08:46:42Z","html_url":"https://github.com/wzwietering/IntroductieProject/pull/25#discussion_r91903123","pull_request_url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/comments/91903123"},"html":{"href":"https://github.com/wzwietering/IntroductieProject/pull/25#discussion_r91903123"},"pull_request":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25","id":97427435,"html_url":"https://github.com/wzwietering/IntroductieProject/pull/25","diff_url":"https://github.com/wzwietering/IntroductieProject/pull/25.diff","patch_url":"https://github.com/wzwietering/IntroductieProject/pull/25.patch","issue_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/25","number":25,"state":"open","locked":false,"title":"Bernd+wilmer/drawing lines","user":{"login":"bvdhoek","id":19154653,"avatar_url":"https://avatars.githubusercontent.com/u/19154653?v=3","gravatar_id":"","url":"https://api.github.com/users/bvdhoek","html_url":"https://github.com/bvdhoek","followers_url":"https://api.github.com/users/bvdhoek/followers","following_url":"https://api.github.com/users/bvdhoek/following{/other_user}","gists_url":"https://api.github.com/users/bvdhoek/gists{/gist_id}","starred_url":"https://api.github.com/users/bvdhoek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvdhoek/subscriptions","organizations_url":"https://api.github.com/users/bvdhoek/orgs","repos_url":"https://api.github.com/users/bvdhoek/repos","events_url":"https://api.github.com/users/bvdhoek/events{/privacy}","received_events_url":"https://api.github.com/users/bvdhoek/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-10T14:56:09Z","updated_at":"2016-12-12T08:47:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0af3cbb264be1b94962a8961d065c48598e40fe4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25/commits","review_comments_url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25/comments","review_comment_url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/25/comments","statuses_url":"https://api.github.com/repos/wzwietering/IntroductieProject/statuses/af0af5dce6300f3b71368e940cba9bad1e8fd054","head":{"label":"wzwietering:bernd+wilmer/drawing-lines","ref":"bernd+wilmer/drawing-lines","sha":"af0af5dce6300f3b71368e940cba9bad1e8fd054","user":{"login":"wzwietering","id":15837844,"avatar_url":"https://avatars.githubusercontent.com/u/15837844?v=3","gravatar_id":"","url":"https://api.github.com/users/wzwietering","html_url":"https://github.com/wzwietering","followers_url":"https://api.github.com/users/wzwietering/followers","following_url":"https://api.github.com/users/wzwietering/following{/other_user}","gists_url":"https://api.github.com/users/wzwietering/gists{/gist_id}","starred_url":"https://api.github.com/users/wzwietering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzwietering/subscriptions","organizations_url":"https://api.github.com/users/wzwietering/orgs","repos_url":"https://api.github.com/users/wzwietering/repos","events_url":"https://api.github.com/users/wzwietering/events{/privacy}","received_events_url":"https://api.github.com/users/wzwietering/received_events","type":"User","site_admin":false},"repo":{"id":73838667,"name":"IntroductieProject","full_name":"wzwietering/IntroductieProject","owner":{"login":"wzwietering","id":15837844,"avatar_url":"https://avatars.githubusercontent.com/u/15837844?v=3","gravatar_id":"","url":"https://api.github.com/users/wzwietering","html_url":"https://github.com/wzwietering","followers_url":"https://api.github.com/users/wzwietering/followers","following_url":"https://api.github.com/users/wzwietering/following{/other_user}","gists_url":"https://api.github.com/users/wzwietering/gists{/gist_id}","starred_url":"https://api.github.com/users/wzwietering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzwietering/subscriptions","organizations_url":"https://api.github.com/users/wzwietering/orgs","repos_url":"https://api.github.com/users/wzwietering/repos","events_url":"https://api.github.com/users/wzwietering/events{/privacy}","received_events_url":"https://api.github.com/users/wzwietering/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wzwietering/IntroductieProject","description":"Application to educate children about electronic circuits","fork":false,"url":"https://api.github.com/repos/wzwietering/IntroductieProject","forks_url":"https://api.github.com/repos/wzwietering/IntroductieProject/forks","keys_url":"https://api.github.com/repos/wzwietering/IntroductieProject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wzwietering/IntroductieProject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wzwietering/IntroductieProject/teams","hooks_url":"https://api.github.com/repos/wzwietering/IntroductieProject/hooks","issue_events_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/events{/number}","events_url":"https://api.github.com/repos/wzwietering/IntroductieProject/events","assignees_url":"https://api.github.com/repos/wzwietering/IntroductieProject/assignees{/user}","branches_url":"https://api.github.com/repos/wzwietering/IntroductieProject/branches{/branch}","tags_url":"https://api.github.com/repos/wzwietering/IntroductieProject/tags","blobs_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/refs{/sha}","trees_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wzwietering/IntroductieProject/statuses/{sha}","languages_url":"https://api.github.com/repos/wzwietering/IntroductieProject/languages","stargazers_url":"https://api.github.com/repos/wzwietering/IntroductieProject/stargazers","contributors_url":"https://api.github.com/repos/wzwietering/IntroductieProject/contributors","subscribers_url":"https://api.github.com/repos/wzwietering/IntroductieProject/subscribers","subscription_url":"https://api.github.com/repos/wzwietering/IntroductieProject/subscription","commits_url":"https://api.github.com/repos/wzwietering/IntroductieProject/commits{/sha}","git_commits_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/commits{/sha}","comments_url":"https://api.github.com/repos/wzwietering/IntroductieProject/comments{/number}","issue_comment_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/comments{/number}","contents_url":"https://api.github.com/repos/wzwietering/IntroductieProject/contents/{+path}","compare_url":"https://api.github.com/repos/wzwietering/IntroductieProject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wzwietering/IntroductieProject/merges","archive_url":"https://api.github.com/repos/wzwietering/IntroductieProject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wzwietering/IntroductieProject/downloads","issues_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues{/number}","pulls_url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls{/number}","milestones_url":"https://api.github.com/repos/wzwietering/IntroductieProject/milestones{/number}","notifications_url":"https://api.github.com/repos/wzwietering/IntroductieProject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wzwietering/IntroductieProject/labels{/name}","releases_url":"https://api.github.com/repos/wzwietering/IntroductieProject/releases{/id}","deployments_url":"https://api.github.com/repos/wzwietering/IntroductieProject/deployments","created_at":"2016-11-15T17:32:18Z","updated_at":"2016-12-08T09:05:50Z","pushed_at":"2016-12-11T20:22:02Z","git_url":"git://github.com/wzwietering/IntroductieProject.git","ssh_url":"git@github.com:wzwietering/IntroductieProject.git","clone_url":"https://github.com/wzwietering/IntroductieProject.git","svn_url":"https://github.com/wzwietering/IntroductieProject","homepage":"","size":775,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"wzwietering:master","ref":"master","sha":"21f95550240ff0d49784ff35bdbf0994faac9307","user":{"login":"wzwietering","id":15837844,"avatar_url":"https://avatars.githubusercontent.com/u/15837844?v=3","gravatar_id":"","url":"https://api.github.com/users/wzwietering","html_url":"https://github.com/wzwietering","followers_url":"https://api.github.com/users/wzwietering/followers","following_url":"https://api.github.com/users/wzwietering/following{/other_user}","gists_url":"https://api.github.com/users/wzwietering/gists{/gist_id}","starred_url":"https://api.github.com/users/wzwietering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzwietering/subscriptions","organizations_url":"https://api.github.com/users/wzwietering/orgs","repos_url":"https://api.github.com/users/wzwietering/repos","events_url":"https://api.github.com/users/wzwietering/events{/privacy}","received_events_url":"https://api.github.com/users/wzwietering/received_events","type":"User","site_admin":false},"repo":{"id":73838667,"name":"IntroductieProject","full_name":"wzwietering/IntroductieProject","owner":{"login":"wzwietering","id":15837844,"avatar_url":"https://avatars.githubusercontent.com/u/15837844?v=3","gravatar_id":"","url":"https://api.github.com/users/wzwietering","html_url":"https://github.com/wzwietering","followers_url":"https://api.github.com/users/wzwietering/followers","following_url":"https://api.github.com/users/wzwietering/following{/other_user}","gists_url":"https://api.github.com/users/wzwietering/gists{/gist_id}","starred_url":"https://api.github.com/users/wzwietering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzwietering/subscriptions","organizations_url":"https://api.github.com/users/wzwietering/orgs","repos_url":"https://api.github.com/users/wzwietering/repos","events_url":"https://api.github.com/users/wzwietering/events{/privacy}","received_events_url":"https://api.github.com/users/wzwietering/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wzwietering/IntroductieProject","description":"Application to educate children about electronic circuits","fork":false,"url":"https://api.github.com/repos/wzwietering/IntroductieProject","forks_url":"https://api.github.com/repos/wzwietering/IntroductieProject/forks","keys_url":"https://api.github.com/repos/wzwietering/IntroductieProject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wzwietering/IntroductieProject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wzwietering/IntroductieProject/teams","hooks_url":"https://api.github.com/repos/wzwietering/IntroductieProject/hooks","issue_events_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/events{/number}","events_url":"https://api.github.com/repos/wzwietering/IntroductieProject/events","assignees_url":"https://api.github.com/repos/wzwietering/IntroductieProject/assignees{/user}","branches_url":"https://api.github.com/repos/wzwietering/IntroductieProject/branches{/branch}","tags_url":"https://api.github.com/repos/wzwietering/IntroductieProject/tags","blobs_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/refs{/sha}","trees_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wzwietering/IntroductieProject/statuses/{sha}","languages_url":"https://api.github.com/repos/wzwietering/IntroductieProject/languages","stargazers_url":"https://api.github.com/repos/wzwietering/IntroductieProject/stargazers","contributors_url":"https://api.github.com/repos/wzwietering/IntroductieProject/contributors","subscribers_url":"https://api.github.com/repos/wzwietering/IntroductieProject/subscribers","subscription_url":"https://api.github.com/repos/wzwietering/IntroductieProject/subscription","commits_url":"https://api.github.com/repos/wzwietering/IntroductieProject/commits{/sha}","git_commits_url":"https://api.github.com/repos/wzwietering/IntroductieProject/git/commits{/sha}","comments_url":"https://api.github.com/repos/wzwietering/IntroductieProject/comments{/number}","issue_comment_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/comments{/number}","contents_url":"https://api.github.com/repos/wzwietering/IntroductieProject/contents/{+path}","compare_url":"https://api.github.com/repos/wzwietering/IntroductieProject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wzwietering/IntroductieProject/merges","archive_url":"https://api.github.com/repos/wzwietering/IntroductieProject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wzwietering/IntroductieProject/downloads","issues_url":"https://api.github.com/repos/wzwietering/IntroductieProject/issues{/number}","pulls_url":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls{/number}","milestones_url":"https://api.github.com/repos/wzwietering/IntroductieProject/milestones{/number}","notifications_url":"https://api.github.com/repos/wzwietering/IntroductieProject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wzwietering/IntroductieProject/labels{/name}","releases_url":"https://api.github.com/repos/wzwietering/IntroductieProject/releases{/id}","deployments_url":"https://api.github.com/repos/wzwietering/IntroductieProject/deployments","created_at":"2016-11-15T17:32:18Z","updated_at":"2016-12-08T09:05:50Z","pushed_at":"2016-12-11T20:22:02Z","git_url":"git://github.com/wzwietering/IntroductieProject.git","ssh_url":"git@github.com:wzwietering/IntroductieProject.git","clone_url":"https://github.com/wzwietering/IntroductieProject.git","svn_url":"https://github.com/wzwietering/IntroductieProject","homepage":"","size":775,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25"},"html":{"href":"https://github.com/wzwietering/IntroductieProject/pull/25"},"issue":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/25"},"comments":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/wzwietering/IntroductieProject/statuses/af0af5dce6300f3b71368e940cba9bad1e8fd054"}}}}
{"actor":{"display_login":"wzwietering"}}