GitHub PullRequestReviewCommentEvent at 2014-12-23 14:19:28
Repository: matlab2tikz
Actor: okomarov
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/comments/22216307","id":22216307,"diff_hunk":"@@ -2417,23 +2417,28 @@ case size(cData,2) % specific y-data is given\n end\n % ==============================================================================\n function [style] = getXYAlignmentOfText(handle, style)\n-% sets the horizontal & vertical alginment options of a text object\n+% sets the horizontal and vertical alignment options of a text object\n     VerticalAlignment = get(handle, 'VerticalAlignment');\n     HorizontalAlignment = get(handle, 'HorizontalAlignment');\n \n+    alignment = '';\n     switch VerticalAlignment\n         case {'top', 'cap'}\n-            style = opts_add(style, 'below');\n+            alignment = [alignment, 'below', ' '];\n         case {'baseline', 'bottom'}\n-            style = opts_add(style, 'above');\n+            alignment = [alignment, 'above', ' '];\n     end\n     switch HorizontalAlignment\n         case 'left'\n-            style = opts_add(style, 'right');\n+            alignment = [alignment, 'right', ' '];\n         case 'right'\n-            style = opts_add(style, 'left');\n+            alignment = [alignment, 'left', ' '];\n+    end    \n+    if ~isempty(strtrim(alignment))\n+        style = opts_add(style, strtrim(alignment));\n     end\n-    % Add Horizontal alignment\n+    \n+    % Set 'align' option that is needed for multiline text\n     style = opts_add(style, 'align', HorizontalAlignment);\n end\n % ==============================================================================","path":"src/matlab2tikz.m","position":34,"original_position":34,"commit_id":"d1eba5d83565255d45031e3d3d7c7cde38e43b0e","original_commit_id":"d1eba5d83565255d45031e3d3d7c7cde38e43b0e","user":{"login":"okomarov","id":3731173,"avatar_url":"https://avatars.githubusercontent.com/u/3731173?v=3","gravatar_id":"","url":"https://api.github.com/users/okomarov","html_url":"https://github.com/okomarov","followers_url":"https://api.github.com/users/okomarov/followers","following_url":"https://api.github.com/users/okomarov/following{/other_user}","gists_url":"https://api.github.com/users/okomarov/gists{/gist_id}","starred_url":"https://api.github.com/users/okomarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okomarov/subscriptions","organizations_url":"https://api.github.com/users/okomarov/orgs","repos_url":"https://api.github.com/users/okomarov/repos","events_url":"https://api.github.com/users/okomarov/events{/privacy}","received_events_url":"https://api.github.com/users/okomarov/received_events","type":"User","site_admin":false},"body":"I think we can make this section a bit clearer, what do you think?\r\n\r\n```matlab\r\nhorizontal = '';\r\nvertical   = '';\r\nswitch VerticalAlignment\r\n    case {'top', 'cap'}\r\n        vertical = 'below';\r\n    case {'baseline', 'bottom'}\r\n        vertical = 'above';\r\nend \r\nswitch HorizontalAlignment \r\n   case 'left'\r\n        horizontal = 'right';\r\n   case 'right'\r\n        horizontal = 'left';   \r\nend\r\nalignment = strtrim(sprintf('%s %s', vertical, horizontal));\r\nif ~isempty(alignment)\r\n     style = opts_add(style, alignment);\r\nend\r\n...\r\n```\r\n","created_at":"2014-12-23T14:19:28Z","updated_at":"2014-12-23T14:19:28Z","html_url":"https://github.com/matlab2tikz/matlab2tikz/pull/491#discussion_r22216307","pull_request_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491","_links":{"self":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/comments/22216307"},"html":{"href":"https://github.com/matlab2tikz/matlab2tikz/pull/491#discussion_r22216307"},"pull_request":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491"}}},"pull_request":{"url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491","id":26072154,"html_url":"https://github.com/matlab2tikz/matlab2tikz/pull/491","diff_url":"https://github.com/matlab2tikz/matlab2tikz/pull/491.diff","patch_url":"https://github.com/matlab2tikz/matlab2tikz/pull/491.patch","issue_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/491","number":491,"state":"open","locked":false,"title":"Fix get xy alignment of text","user":{"login":"PeterPablo","id":4340267,"avatar_url":"https://avatars.githubusercontent.com/u/4340267?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterPablo","html_url":"https://github.com/PeterPablo","followers_url":"https://api.github.com/users/PeterPablo/followers","following_url":"https://api.github.com/users/PeterPablo/following{/other_user}","gists_url":"https://api.github.com/users/PeterPablo/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterPablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterPablo/subscriptions","organizations_url":"https://api.github.com/users/PeterPablo/orgs","repos_url":"https://api.github.com/users/PeterPablo/repos","events_url":"https://api.github.com/users/PeterPablo/events{/privacy}","received_events_url":"https://api.github.com/users/PeterPablo/received_events","type":"User","site_admin":false},"body":"* proper handling of cases with both vertical and horizontal alignment\r\n (see chapter 17.5.2 Basic Placement Options of pgfmanual)\r\n* improve comments\r\n* add testcase (currently number 97)","created_at":"2014-12-15T14:25:05Z","updated_at":"2014-12-23T14:19:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80f35f63cb2dc2a8ca53bcee398bedb6768ce9dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491/commits","review_comments_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491/comments","review_comment_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/comments/{number}","comments_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/491/comments","statuses_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/statuses/d1eba5d83565255d45031e3d3d7c7cde38e43b0e","head":{"label":"PeterPablo:fix_getXYAlignmentOfText","ref":"fix_getXYAlignmentOfText","sha":"d1eba5d83565255d45031e3d3d7c7cde38e43b0e","user":{"login":"PeterPablo","id":4340267,"avatar_url":"https://avatars.githubusercontent.com/u/4340267?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterPablo","html_url":"https://github.com/PeterPablo","followers_url":"https://api.github.com/users/PeterPablo/followers","following_url":"https://api.github.com/users/PeterPablo/following{/other_user}","gists_url":"https://api.github.com/users/PeterPablo/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterPablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterPablo/subscriptions","organizations_url":"https://api.github.com/users/PeterPablo/orgs","repos_url":"https://api.github.com/users/PeterPablo/repos","events_url":"https://api.github.com/users/PeterPablo/events{/privacy}","received_events_url":"https://api.github.com/users/PeterPablo/received_events","type":"User","site_admin":false},"repo":{"id":11974000,"name":"matlab2tikz","full_name":"PeterPablo/matlab2tikz","owner":{"login":"PeterPablo","id":4340267,"avatar_url":"https://avatars.githubusercontent.com/u/4340267?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterPablo","html_url":"https://github.com/PeterPablo","followers_url":"https://api.github.com/users/PeterPablo/followers","following_url":"https://api.github.com/users/PeterPablo/following{/other_user}","gists_url":"https://api.github.com/users/PeterPablo/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterPablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterPablo/subscriptions","organizations_url":"https://api.github.com/users/PeterPablo/orgs","repos_url":"https://api.github.com/users/PeterPablo/repos","events_url":"https://api.github.com/users/PeterPablo/events{/privacy}","received_events_url":"https://api.github.com/users/PeterPablo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PeterPablo/matlab2tikz","description":"A converter that takes a MATLAB(R) figure and spits out a TikZ (Pgfplots) figure for smooth integration into LaTeX. ","fork":true,"url":"https://api.github.com/repos/PeterPablo/matlab2tikz","forks_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/forks","keys_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/teams","hooks_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/hooks","issue_events_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/issues/events{/number}","events_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/events","assignees_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/assignees{/user}","branches_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/branches{/branch}","tags_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/tags","blobs_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/git/refs{/sha}","trees_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/statuses/{sha}","languages_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/languages","stargazers_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/stargazers","contributors_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/contributors","subscribers_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/subscribers","subscription_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/subscription","commits_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/commits{/sha}","git_commits_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/git/commits{/sha}","comments_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/comments{/number}","issue_comment_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/issues/comments/{number}","contents_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/contents/{+path}","compare_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/merges","archive_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/downloads","issues_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/issues{/number}","pulls_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/pulls{/number}","milestones_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/milestones{/number}","notifications_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/labels{/name}","releases_url":"https://api.github.com/repos/PeterPablo/matlab2tikz/releases{/id}","created_at":"2013-08-08T10:37:30Z","updated_at":"2014-12-02T14:41:52Z","pushed_at":"2014-12-17T17:21:36Z","git_url":"git://github.com/PeterPablo/matlab2tikz.git","ssh_url":"git@github.com:PeterPablo/matlab2tikz.git","clone_url":"https://github.com/PeterPablo/matlab2tikz.git","svn_url":"https://github.com/PeterPablo/matlab2tikz","homepage":"http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz","size":5393,"stargazers_count":0,"watchers_count":0,"language":"Matlab","has_issues":false,"has_downloads":false,"has_wiki":true,"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":"matlab2tikz:develop","ref":"develop","sha":"32a09d3e910e2c17c69ff3515eb516c37e8b6252","user":{"login":"matlab2tikz","id":10036397,"avatar_url":"https://avatars.githubusercontent.com/u/10036397?v=3","gravatar_id":"","url":"https://api.github.com/users/matlab2tikz","html_url":"https://github.com/matlab2tikz","followers_url":"https://api.github.com/users/matlab2tikz/followers","following_url":"https://api.github.com/users/matlab2tikz/following{/other_user}","gists_url":"https://api.github.com/users/matlab2tikz/gists{/gist_id}","starred_url":"https://api.github.com/users/matlab2tikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matlab2tikz/subscriptions","organizations_url":"https://api.github.com/users/matlab2tikz/orgs","repos_url":"https://api.github.com/users/matlab2tikz/repos","events_url":"https://api.github.com/users/matlab2tikz/events{/privacy}","received_events_url":"https://api.github.com/users/matlab2tikz/received_events","type":"Organization","site_admin":false},"repo":{"id":579842,"name":"matlab2tikz","full_name":"matlab2tikz/matlab2tikz","owner":{"login":"matlab2tikz","id":10036397,"avatar_url":"https://avatars.githubusercontent.com/u/10036397?v=3","gravatar_id":"","url":"https://api.github.com/users/matlab2tikz","html_url":"https://github.com/matlab2tikz","followers_url":"https://api.github.com/users/matlab2tikz/followers","following_url":"https://api.github.com/users/matlab2tikz/following{/other_user}","gists_url":"https://api.github.com/users/matlab2tikz/gists{/gist_id}","starred_url":"https://api.github.com/users/matlab2tikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matlab2tikz/subscriptions","organizations_url":"https://api.github.com/users/matlab2tikz/orgs","repos_url":"https://api.github.com/users/matlab2tikz/repos","events_url":"https://api.github.com/users/matlab2tikz/events{/privacy}","received_events_url":"https://api.github.com/users/matlab2tikz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matlab2tikz/matlab2tikz","description":"A converter that takes a MATLAB(R) figure and spits out a TikZ (Pgfplots) figure for smooth integration into LaTeX. ","fork":false,"url":"https://api.github.com/repos/matlab2tikz/matlab2tikz","forks_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/forks","keys_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/teams","hooks_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/hooks","issue_events_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/events{/number}","events_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/events","assignees_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/assignees{/user}","branches_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/branches{/branch}","tags_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/tags","blobs_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/git/refs{/sha}","trees_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/statuses/{sha}","languages_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/languages","stargazers_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/stargazers","contributors_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/contributors","subscribers_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/subscribers","subscription_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/subscription","commits_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/commits{/sha}","git_commits_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/git/commits{/sha}","comments_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/comments{/number}","issue_comment_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/comments/{number}","contents_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/contents/{+path}","compare_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/merges","archive_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/downloads","issues_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues{/number}","pulls_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls{/number}","milestones_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/milestones{/number}","notifications_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/labels{/name}","releases_url":"https://api.github.com/repos/matlab2tikz/matlab2tikz/releases{/id}","created_at":"2010-03-25T22:52:27Z","updated_at":"2014-12-23T03:18:43Z","pushed_at":"2014-12-19T22:23:13Z","git_url":"git://github.com/matlab2tikz/matlab2tikz.git","ssh_url":"git@github.com:matlab2tikz/matlab2tikz.git","clone_url":"https://github.com/matlab2tikz/matlab2tikz.git","svn_url":"https://github.com/matlab2tikz/matlab2tikz","homepage":"http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz","size":7427,"stargazers_count":243,"watchers_count":243,"language":"Matlab","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":79,"forks":72,"open_issues":79,"watchers":243,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491"},"html":{"href":"https://github.com/matlab2tikz/matlab2tikz/pull/491"},"issue":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/491"},"comments":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/issues/491/comments"},"review_comments":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491/comments"},"review_comment":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/pulls/491/commits"},"statuses":{"href":"https://api.github.com/repos/matlab2tikz/matlab2tikz/statuses/d1eba5d83565255d45031e3d3d7c7cde38e43b0e"}}}}