{"action":"created","issue":{"url":"https://api.github.com/repos/pygame/pygame/issues/512","repository_url":"https://api.github.com/repos/pygame/pygame","labels_url":"https://api.github.com/repos/pygame/pygame/issues/512/labels{/name}","comments_url":"https://api.github.com/repos/pygame/pygame/issues/512/comments","events_url":"https://api.github.com/repos/pygame/pygame/issues/512/events","html_url":"https://github.com/pygame/pygame/issues/512","id":354765828,"node_id":"MDU6SXNzdWUzNTQ3NjU4Mjg=","number":512,"title":"Lines drawn with aaline() and aalines() contain gaps or aren't drawn","user":{"login":"amosbastian","id":9199433,"node_id":"MDQ6VXNlcjkxOTk0MzM=","avatar_url":"https://avatars1.githubusercontent.com/u/9199433?v=4","gravatar_id":"","url":"https://api.github.com/users/amosbastian","html_url":"https://github.com/amosbastian","followers_url":"https://api.github.com/users/amosbastian/followers","following_url":"https://api.github.com/users/amosbastian/following{/other_user}","gists_url":"https://api.github.com/users/amosbastian/gists{/gist_id}","starred_url":"https://api.github.com/users/amosbastian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amosbastian/subscriptions","organizations_url":"https://api.github.com/users/amosbastian/orgs","repos_url":"https://api.github.com/users/amosbastian/repos","events_url":"https://api.github.com/users/amosbastian/events{/privacy}","received_events_url":"https://api.github.com/users/amosbastian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-28T14:46:42Z","updated_at":"2018-08-29T12:30:19Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Using `draw.aaline(s)` to draw lines sometimes doesn't work at all (when close to the border of the surface) or contains gaps.\r\n\r\nWhat's left to do:\r\n\r\n- [x] Example showing error\r\n- [x] Write a unit test in `test/draw_test.py`\r\n- [ ] Create a fix in [src_c/draw.c](https://github.com/pygame/pygame/blob/master/src_c/draw.c)\r\n\r\n---\r\n\r\nFor some reason `draw.aaline` does not draw anything when it's on the border of a surface (not sure if it's intended).\r\n\r\n```python\r\nimport pygame\r\nfrom pygame.locals import QUIT\r\npygame.init()\r\nsurface = pygame.display.set_mode((50, 50))\r\npygame.draw.aaline(surface, (0, 0, 255), (0, 0), (50, 50))\r\n\r\nprint(surface.get_at((0, 0)))\r\ngoing = True\r\nwhile going:\r\n    pygame.display.update()\r\n    for event in pygame.event.get():\r\n        if event.type == QUIT:\r\n            going = False\r\n```\r\n\r\ngives the following image:\r\n\r\n![image](https://user-images.githubusercontent.com/9199433/44730334-9ab4d400-aad8-11e8-85a8-d2adc7106064.png)\r\n\r\nSame thing happens when drawing lines around the border with `aalines()`. Even when drawing it just inside the border of the surface it gives lines that contain gaps, as seen below:\r\n\r\n```python\r\npygame.draw.aalines(surface, (0, 0, 255), True, [(1, 1), (48, 1), (48, 48), (1, 48)])\r\n```\r\n![image](https://user-images.githubusercontent.com/9199433/44730447-e1a2c980-aad8-11e8-8983-b5623fe5f86c.png)\r\n\r\nEven this\r\n\r\n```\r\npygame.draw.aalines(surface, (0, 0, 255), True, [(1, 1), (49, 0), (49, 49), (0, 49)])\r\n```\r\n\r\nonly draws 1 pixel at `(1, 1)`."},"comment":{"url":"https://api.github.com/repos/pygame/pygame/issues/comments/416935045","html_url":"https://github.com/pygame/pygame/issues/512#issuecomment-416935045","issue_url":"https://api.github.com/repos/pygame/pygame/issues/512","id":416935045,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjkzNTA0NQ==","user":{"login":"e1000","id":1076025,"node_id":"MDQ6VXNlcjEwNzYwMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1076025?v=4","gravatar_id":"","url":"https://api.github.com/users/e1000","html_url":"https://github.com/e1000","followers_url":"https://api.github.com/users/e1000/followers","following_url":"https://api.github.com/users/e1000/following{/other_user}","gists_url":"https://api.github.com/users/e1000/gists{/gist_id}","starred_url":"https://api.github.com/users/e1000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e1000/subscriptions","organizations_url":"https://api.github.com/users/e1000/orgs","repos_url":"https://api.github.com/users/e1000/repos","events_url":"https://api.github.com/users/e1000/events{/privacy}","received_events_url":"https://api.github.com/users/e1000/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T12:30:19Z","updated_at":"2018-08-29T12:30:19Z","author_association":"NONE","body":"Here is another strange thing : \r\n```python\r\nimport pygame\r\npygame.init()\r\n\r\n\r\nsurface = pygame.display.set_mode((50, 50))\r\n\r\n# one green rectangle\r\npygame.draw.rect(surface, (0, 255, 100), (5, 5, 40, 40), 0)\r\n\r\n# one magenta multi-line\r\npygame.draw.aalines(surface, (255, 0, 255), False,\r\n        [(10, 20), (10, 10), (30, 30), (20, 40)])\r\npygame.image.save(surface, 'this-is-the-result.bmp')\r\n```\r\nresults in : \r\n![screen08-29-14h18](https://user-images.githubusercontent.com/1076025/44787415-5dfbe200-ab97-11e8-9d25-ddd8b9756298.png)\r\n\r\n \r\nI do not understand the *black* pixels created by `aalines` ;\r\n\r\n also I'm not sure how `blend=1` is to be interpreted, but the *dark-magenta* seems buggy to me."}}
{"actor":{"display_login":"e1000"}}