{"action":"created","comment":{"url":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments/58601834","id":58601834,"diff_hunk":"@@ -288,12 +288,20 @@ bool isOutsideTile(const glm::vec3& _a, const glm::vec3& _b) {\n     return false;\n }\n \n-void buildPolyLineSegment(const Line& _line, PolyLineBuilder& _ctx) {\n+void buildPolyLineSegment(const Line& _line, PolyLineBuilder& _ctx,\n+                          size_t startIndex, size_t endIndex, bool endCap = true) {\n \n-    int lineSize = (int)_line.size();\n+    size_t origLineSize = _line.size();\n+\n+    // endIndex/startIndex could be wrapped values, calculate lineSize accordingly\n+    int lineSize = (int)((endIndex > startIndex) ?\n+                   (endIndex - startIndex) :\n+                   (origLineSize - startIndex + endIndex));","path":"core/src/util/builders.cpp","position":14,"original_position":14,"commit_id":"ea96e85a470333f06deef91255281d50dd418bc1","original_commit_id":"ea96e85a470333f06deef91255281d50dd418bc1","user":{"login":"blair1618","id":3371850,"avatar_url":"https://avatars.githubusercontent.com/u/3371850?v=3","gravatar_id":"","url":"https://api.github.com/users/blair1618","html_url":"https://github.com/blair1618","followers_url":"https://api.github.com/users/blair1618/followers","following_url":"https://api.github.com/users/blair1618/following{/other_user}","gists_url":"https://api.github.com/users/blair1618/gists{/gist_id}","starred_url":"https://api.github.com/users/blair1618/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blair1618/subscriptions","organizations_url":"https://api.github.com/users/blair1618/orgs","repos_url":"https://api.github.com/users/blair1618/repos","events_url":"https://api.github.com/users/blair1618/events{/privacy}","received_events_url":"https://api.github.com/users/blair1618/received_events","type":"User","site_admin":false},"body":"Ahh I see what's going on here, wrapping indices can make the arithmetic tricky. Do you think it would be cleaner to use a while loop over the intermediate points instead?","created_at":"2016-04-05T19:37:22Z","updated_at":"2016-04-05T19:37:22Z","html_url":"https://github.com/tangrams/tangram-es/pull/659#discussion_r58601834","pull_request_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/659","_links":{"self":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments/58601834"},"html":{"href":"https://github.com/tangrams/tangram-es/pull/659#discussion_r58601834"},"pull_request":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/659"}}},"pull_request":{"url":"https://api.github.com/repos/tangrams/tangram-es/pulls/659","id":65017613,"html_url":"https://github.com/tangrams/tangram-es/pull/659","diff_url":"https://github.com/tangrams/tangram-es/pull/659.diff","patch_url":"https://github.com/tangrams/tangram-es/pull/659.patch","issue_url":"https://api.github.com/repos/tangrams/tangram-es/issues/659","number":659,"state":"open","locked":false,"title":"Polyline join","user":{"login":"tallytalwar","id":360641,"avatar_url":"https://avatars.githubusercontent.com/u/360641?v=3","gravatar_id":"","url":"https://api.github.com/users/tallytalwar","html_url":"https://github.com/tallytalwar","followers_url":"https://api.github.com/users/tallytalwar/followers","following_url":"https://api.github.com/users/tallytalwar/following{/other_user}","gists_url":"https://api.github.com/users/tallytalwar/gists{/gist_id}","starred_url":"https://api.github.com/users/tallytalwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tallytalwar/subscriptions","organizations_url":"https://api.github.com/users/tallytalwar/orgs","repos_url":"https://api.github.com/users/tallytalwar/repos","events_url":"https://api.github.com/users/tallytalwar/events{/privacy}","received_events_url":"https://api.github.com/users/tallytalwar/received_events","type":"User","site_admin":false},"body":"Fixes #550\r\n\r\nTodo:\r\n- [x] test more to resolve some edge cases.","created_at":"2016-04-01T23:19:52Z","updated_at":"2016-04-05T19:37:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6598b80472a129c4b36a8d425fb68d218ace82ee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/659/commits","review_comments_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/659/comments","review_comment_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tangrams/tangram-es/issues/659/comments","statuses_url":"https://api.github.com/repos/tangrams/tangram-es/statuses/ea96e85a470333f06deef91255281d50dd418bc1","head":{"label":"tangrams:polylineJoin","ref":"polylineJoin","sha":"ea96e85a470333f06deef91255281d50dd418bc1","user":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"repo":{"id":23391501,"name":"tangram-es","full_name":"tangrams/tangram-es","owner":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tangrams/tangram-es","description":"2D and 3D map renderer using OpenGL ES","fork":false,"url":"https://api.github.com/repos/tangrams/tangram-es","forks_url":"https://api.github.com/repos/tangrams/tangram-es/forks","keys_url":"https://api.github.com/repos/tangrams/tangram-es/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tangrams/tangram-es/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tangrams/tangram-es/teams","hooks_url":"https://api.github.com/repos/tangrams/tangram-es/hooks","issue_events_url":"https://api.github.com/repos/tangrams/tangram-es/issues/events{/number}","events_url":"https://api.github.com/repos/tangrams/tangram-es/events","assignees_url":"https://api.github.com/repos/tangrams/tangram-es/assignees{/user}","branches_url":"https://api.github.com/repos/tangrams/tangram-es/branches{/branch}","tags_url":"https://api.github.com/repos/tangrams/tangram-es/tags","blobs_url":"https://api.github.com/repos/tangrams/tangram-es/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tangrams/tangram-es/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tangrams/tangram-es/git/refs{/sha}","trees_url":"https://api.github.com/repos/tangrams/tangram-es/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tangrams/tangram-es/statuses/{sha}","languages_url":"https://api.github.com/repos/tangrams/tangram-es/languages","stargazers_url":"https://api.github.com/repos/tangrams/tangram-es/stargazers","contributors_url":"https://api.github.com/repos/tangrams/tangram-es/contributors","subscribers_url":"https://api.github.com/repos/tangrams/tangram-es/subscribers","subscription_url":"https://api.github.com/repos/tangrams/tangram-es/subscription","commits_url":"https://api.github.com/repos/tangrams/tangram-es/commits{/sha}","git_commits_url":"https://api.github.com/repos/tangrams/tangram-es/git/commits{/sha}","comments_url":"https://api.github.com/repos/tangrams/tangram-es/comments{/number}","issue_comment_url":"https://api.github.com/repos/tangrams/tangram-es/issues/comments{/number}","contents_url":"https://api.github.com/repos/tangrams/tangram-es/contents/{+path}","compare_url":"https://api.github.com/repos/tangrams/tangram-es/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tangrams/tangram-es/merges","archive_url":"https://api.github.com/repos/tangrams/tangram-es/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tangrams/tangram-es/downloads","issues_url":"https://api.github.com/repos/tangrams/tangram-es/issues{/number}","pulls_url":"https://api.github.com/repos/tangrams/tangram-es/pulls{/number}","milestones_url":"https://api.github.com/repos/tangrams/tangram-es/milestones{/number}","notifications_url":"https://api.github.com/repos/tangrams/tangram-es/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tangrams/tangram-es/labels{/name}","releases_url":"https://api.github.com/repos/tangrams/tangram-es/releases{/id}","deployments_url":"https://api.github.com/repos/tangrams/tangram-es/deployments","created_at":"2014-08-27T13:56:56Z","updated_at":"2016-03-30T07:10:22Z","pushed_at":"2016-04-05T18:37:04Z","git_url":"git://github.com/tangrams/tangram-es.git","ssh_url":"git@github.com:tangrams/tangram-es.git","clone_url":"https://github.com/tangrams/tangram-es.git","svn_url":"https://github.com/tangrams/tangram-es","homepage":"","size":35980,"stargazers_count":95,"watchers_count":95,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":54,"forks":32,"open_issues":54,"watchers":95,"default_branch":"master"}},"base":{"label":"tangrams:master","ref":"master","sha":"d3470344a6dac799a56d7811d93493aba8c6a3e2","user":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"repo":{"id":23391501,"name":"tangram-es","full_name":"tangrams/tangram-es","owner":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tangrams/tangram-es","description":"2D and 3D map renderer using OpenGL ES","fork":false,"url":"https://api.github.com/repos/tangrams/tangram-es","forks_url":"https://api.github.com/repos/tangrams/tangram-es/forks","keys_url":"https://api.github.com/repos/tangrams/tangram-es/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tangrams/tangram-es/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tangrams/tangram-es/teams","hooks_url":"https://api.github.com/repos/tangrams/tangram-es/hooks","issue_events_url":"https://api.github.com/repos/tangrams/tangram-es/issues/events{/number}","events_url":"https://api.github.com/repos/tangrams/tangram-es/events","assignees_url":"https://api.github.com/repos/tangrams/tangram-es/assignees{/user}","branches_url":"https://api.github.com/repos/tangrams/tangram-es/branches{/branch}","tags_url":"https://api.github.com/repos/tangrams/tangram-es/tags","blobs_url":"https://api.github.com/repos/tangrams/tangram-es/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tangrams/tangram-es/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tangrams/tangram-es/git/refs{/sha}","trees_url":"https://api.github.com/repos/tangrams/tangram-es/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tangrams/tangram-es/statuses/{sha}","languages_url":"https://api.github.com/repos/tangrams/tangram-es/languages","stargazers_url":"https://api.github.com/repos/tangrams/tangram-es/stargazers","contributors_url":"https://api.github.com/repos/tangrams/tangram-es/contributors","subscribers_url":"https://api.github.com/repos/tangrams/tangram-es/subscribers","subscription_url":"https://api.github.com/repos/tangrams/tangram-es/subscription","commits_url":"https://api.github.com/repos/tangrams/tangram-es/commits{/sha}","git_commits_url":"https://api.github.com/repos/tangrams/tangram-es/git/commits{/sha}","comments_url":"https://api.github.com/repos/tangrams/tangram-es/comments{/number}","issue_comment_url":"https://api.github.com/repos/tangrams/tangram-es/issues/comments{/number}","contents_url":"https://api.github.com/repos/tangrams/tangram-es/contents/{+path}","compare_url":"https://api.github.com/repos/tangrams/tangram-es/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tangrams/tangram-es/merges","archive_url":"https://api.github.com/repos/tangrams/tangram-es/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tangrams/tangram-es/downloads","issues_url":"https://api.github.com/repos/tangrams/tangram-es/issues{/number}","pulls_url":"https://api.github.com/repos/tangrams/tangram-es/pulls{/number}","milestones_url":"https://api.github.com/repos/tangrams/tangram-es/milestones{/number}","notifications_url":"https://api.github.com/repos/tangrams/tangram-es/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tangrams/tangram-es/labels{/name}","releases_url":"https://api.github.com/repos/tangrams/tangram-es/releases{/id}","deployments_url":"https://api.github.com/repos/tangrams/tangram-es/deployments","created_at":"2014-08-27T13:56:56Z","updated_at":"2016-03-30T07:10:22Z","pushed_at":"2016-04-05T18:37:04Z","git_url":"git://github.com/tangrams/tangram-es.git","ssh_url":"git@github.com:tangrams/tangram-es.git","clone_url":"https://github.com/tangrams/tangram-es.git","svn_url":"https://github.com/tangrams/tangram-es","homepage":"","size":35980,"stargazers_count":95,"watchers_count":95,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":54,"forks":32,"open_issues":54,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/659"},"html":{"href":"https://github.com/tangrams/tangram-es/pull/659"},"issue":{"href":"https://api.github.com/repos/tangrams/tangram-es/issues/659"},"comments":{"href":"https://api.github.com/repos/tangrams/tangram-es/issues/659/comments"},"review_comments":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/659/comments"},"review_comment":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/659/commits"},"statuses":{"href":"https://api.github.com/repos/tangrams/tangram-es/statuses/ea96e85a470333f06deef91255281d50dd418bc1"}}}}