{"action":"created","issue":{"url":"https://api.github.com/repos/AaronLiddiment/LEDMatrix/issues/5","repository_url":"https://api.github.com/repos/AaronLiddiment/LEDMatrix","labels_url":"https://api.github.com/repos/AaronLiddiment/LEDMatrix/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/AaronLiddiment/LEDMatrix/issues/5/comments","events_url":"https://api.github.com/repos/AaronLiddiment/LEDMatrix/issues/5/events","html_url":"https://github.com/AaronLiddiment/LEDMatrix/issues/5","id":200000968,"node_id":"MDU6SXNzdWUyMDAwMDA5Njg=","number":5,"title":"DrawLine() exceptions when the starting point and end point are exactly the same.","user":{"login":"joehui","id":8858936,"node_id":"MDQ6VXNlcjg4NTg5MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/8858936?v=4","gravatar_id":"","url":"https://api.github.com/users/joehui","html_url":"https://github.com/joehui","followers_url":"https://api.github.com/users/joehui/followers","following_url":"https://api.github.com/users/joehui/following{/other_user}","gists_url":"https://api.github.com/users/joehui/gists{/gist_id}","starred_url":"https://api.github.com/users/joehui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehui/subscriptions","organizations_url":"https://api.github.com/users/joehui/orgs","repos_url":"https://api.github.com/users/joehui/repos","events_url":"https://api.github.com/users/joehui/events{/privacy}","received_events_url":"https://api.github.com/users/joehui/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-11T04:28:57Z","updated_at":"2018-08-17T18:51:37Z","closed_at":"2018-08-17T18:51:37Z","author_association":"NONE","body":"Tested this on ESP8266, it crashed because of division by zero on the line:\r\n\r\n```\r\n             int32_t f = ((int32_t)dy << 16) / (int32_t)abs(dx);\r\n```\r\n\r\nbecause both dx and dy are zero.\r\n\r\nI corrected the code by adding a condition for when dx and dy are both zeros.  The first few lines of the function becomes:\r\n\r\n```\r\nvoid cLEDMatrixBase::DrawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, CRGB Col)\r\n{\r\n  int16_t dx = x1 - x0;\r\n  int16_t dy = y1 - y0;\r\n  \r\n  if (dx==0 && dy==0) {\r\n  \t(*this)(x0, y0) = Col;\r\n  }\r\n  else if (abs(dx) >= abs(dy))\r\n  {\r\n    ......\r\n```\r\n\r\nI hope you can put this fix in your official code.\r\n"},"comment":{"url":"https://api.github.com/repos/AaronLiddiment/LEDMatrix/issues/comments/413957543","html_url":"https://github.com/AaronLiddiment/LEDMatrix/issues/5#issuecomment-413957543","issue_url":"https://api.github.com/repos/AaronLiddiment/LEDMatrix/issues/5","id":413957543,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzk1NzU0Mw==","user":{"login":"AaronLiddiment","id":8125456,"node_id":"MDQ6VXNlcjgxMjU0NTY=","avatar_url":"https://avatars2.githubusercontent.com/u/8125456?v=4","gravatar_id":"","url":"https://api.github.com/users/AaronLiddiment","html_url":"https://github.com/AaronLiddiment","followers_url":"https://api.github.com/users/AaronLiddiment/followers","following_url":"https://api.github.com/users/AaronLiddiment/following{/other_user}","gists_url":"https://api.github.com/users/AaronLiddiment/gists{/gist_id}","starred_url":"https://api.github.com/users/AaronLiddiment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AaronLiddiment/subscriptions","organizations_url":"https://api.github.com/users/AaronLiddiment/orgs","repos_url":"https://api.github.com/users/AaronLiddiment/repos","events_url":"https://api.github.com/users/AaronLiddiment/events{/privacy}","received_events_url":"https://api.github.com/users/AaronLiddiment/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T18:51:37Z","updated_at":"2018-08-17T18:51:37Z","author_association":"OWNER","body":"ok, fixed, closed."}}
{"actor":{"display_login":"AaronLiddiment"}}