{"url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/615","repository_url":"https://api.github.com/repos/open-cogsci/OpenSesame","labels_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/615/labels{/name}","comments_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/615/comments","events_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/615/events","html_url":"https://github.com/open-cogsci/OpenSesame/issues/615","id":308337532,"node_id":"MDU6SXNzdWUzMDgzMzc1MzI=","number":615,"title":"Canvas.elements_at wrong for circles","user":{"login":"wolfgangwalther","id":9132420,"node_id":"MDQ6VXNlcjkxMzI0MjA=","avatar_url":"https://avatars.githubusercontent.com/u/9132420?v=4","gravatar_id":"","url":"https://api.github.com/users/wolfgangwalther","html_url":"https://github.com/wolfgangwalther","followers_url":"https://api.github.com/users/wolfgangwalther/followers","following_url":"https://api.github.com/users/wolfgangwalther/following{/other_user}","gists_url":"https://api.github.com/users/wolfgangwalther/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfgangwalther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfgangwalther/subscriptions","organizations_url":"https://api.github.com/users/wolfgangwalther/orgs","repos_url":"https://api.github.com/users/wolfgangwalther/repos","events_url":"https://api.github.com/users/wolfgangwalther/events{/privacy}","received_events_url":"https://api.github.com/users/wolfgangwalther/received_events","type":"User","user_view_type":"public","site_admin":false},"labels":[{"id":425538403,"node_id":"MDU6TGFiZWw0MjU1Mzg0MDM=","url":"https://api.github.com/repos/open-cogsci/OpenSesame/labels/Bug","name":"Bug","color":"FF9800","default":false,"description":null}],"state":"closed","locked":false,"assignees":[{"login":"smathot","id":594936,"node_id":"MDQ6VXNlcjU5NDkzNg==","avatar_url":"https://avatars.githubusercontent.com/u/594936?v=4","gravatar_id":"","url":"https://api.github.com/users/smathot","html_url":"https://github.com/smathot","followers_url":"https://api.github.com/users/smathot/followers","following_url":"https://api.github.com/users/smathot/following{/other_user}","gists_url":"https://api.github.com/users/smathot/gists{/gist_id}","starred_url":"https://api.github.com/users/smathot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smathot/subscriptions","organizations_url":"https://api.github.com/users/smathot/orgs","repos_url":"https://api.github.com/users/smathot/repos","events_url":"https://api.github.com/users/smathot/events{/privacy}","received_events_url":"https://api.github.com/users/smathot/received_events","type":"User","user_view_type":"public","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-03-25T10:12:32Z","updated_at":"2018-03-30T15:22:15Z","closed_at":"2018-03-30T15:22:15Z","assignee":{"login":"smathot","id":594936,"node_id":"MDQ6VXNlcjU5NDkzNg==","avatar_url":"https://avatars.githubusercontent.com/u/594936?v=4","gravatar_id":"","url":"https://api.github.com/users/smathot","html_url":"https://github.com/smathot","followers_url":"https://api.github.com/users/smathot/followers","following_url":"https://api.github.com/users/smathot/following{/other_user}","gists_url":"https://api.github.com/users/smathot/gists{/gist_id}","starred_url":"https://api.github.com/users/smathot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smathot/subscriptions","organizations_url":"https://api.github.com/users/smathot/orgs","repos_url":"https://api.github.com/users/smathot/repos","events_url":"https://api.github.com/users/smathot/events{/privacy}","received_events_url":"https://api.github.com/users/smathot/received_events","type":"User","user_view_type":"public","site_admin":false},"author_association":"CONTRIBUTOR","issue_field_values":[],"type":null,"active_lock_reason":null,"sub_issues_summary":{"total":0,"completed":0,"percent_completed":0},"issue_dependencies_summary":{"blocked_by":0,"total_blocked_by":0,"blocking":0,"total_blocking":0},"body":"`Canvas.elements_at` depends on the `in` operator for each element. `Circle` uses the default definition (`Element` base class) of `__contains__`.\r\n\r\nTwo problems:\r\n1) The default is a rectangular hit area. Needs to be a circle.\r\n2) The hit area is shifted to the lower right, because the center of the circle is used as the origin (ie top left corner) of the rect.\r\n\r\nTest case - try clicking different parts on and out of the circle:\r\n```python\r\nc = Canvas()\r\nc['test'] = Circle(0, 0, 100, fill=True, color='blue')\r\nc.show()\r\nm = Mouse(buttonlist=[1], visible=True)\r\nwhile True:\r\n\t_, (x, y), _ = m.get_click()\r\n\tprint(c.elements_at(x,y))\r\n```","closed_by":{"login":"smathot","id":594936,"node_id":"MDQ6VXNlcjU5NDkzNg==","avatar_url":"https://avatars.githubusercontent.com/u/594936?v=4","gravatar_id":"","url":"https://api.github.com/users/smathot","html_url":"https://github.com/smathot","followers_url":"https://api.github.com/users/smathot/followers","following_url":"https://api.github.com/users/smathot/following{/other_user}","gists_url":"https://api.github.com/users/smathot/gists{/gist_id}","starred_url":"https://api.github.com/users/smathot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smathot/subscriptions","organizations_url":"https://api.github.com/users/smathot/orgs","repos_url":"https://api.github.com/users/smathot/repos","events_url":"https://api.github.com/users/smathot/events{/privacy}","received_events_url":"https://api.github.com/users/smathot/received_events","type":"User","user_view_type":"public","site_admin":false},"reactions":{"url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/615/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/615/timeline","performed_via_github_app":null,"state_reason":"completed","pinned_comment":null}