circuitpython/shared-module/vectorio
Kenny 8de5f90086 vectorio contains(x, y)
new utility function for all vectorio shape specializations for testing
whether a screen-space x,y point falls within a shape's x,y.

This respects the current orientation of the screen in the manner of
displayio and vectorio - so your x,y requests are in the same coordinate
domain as your x,y locations and your width/height etc. properties that
ou set on other shapes. I.e., if you're using this for touch points then
you will need to make sure the touch events are in the same x,y domain as
your display.

```
contains(2, 4) -> true
------------------
|                |
|                |
| --             |
| | \            |
| |. \           |
| |   \          |
| |____\         |
|                |
------------------

contains(5, 4) -> false
------------------
|                |
|                |
| --             |
| | \            |
| |  \.          |
| |   \          |
| |____\         |
|                |
------------------
```

This helps provide low overhead introspection of shape coverage on screen.
It's envisioned that this will be used for things like touch-and-drag
widget controls, touch "areas" and may help with random ornament placement
on toy Christmas trees.
2021-12-27 12:01:19 -10:00
..
Circle.c vectorio: add draw protocol 2021-08-02 20:19:54 -07:00
Circle.h vectorio: add draw protocol 2021-08-02 20:19:54 -07:00
Polygon.c Remove unused varg part of Error calls. 2021-09-10 09:39:20 +01:00
Polygon.h improve transpose and mirror 2021-08-07 19:31:22 -07:00
Rectangle.c vectorio: Add width and height properties to rectangle 2021-12-12 19:50:00 -08:00
Rectangle.h vectorio: Add width and height properties to rectangle 2021-12-12 19:50:00 -08:00
VectorShape.c vectorio contains(x, y) 2021-12-27 12:01:19 -10:00
VectorShape.h Make the x and y bounds checking functions static 2021-09-11 17:10:21 +01:00
__init__.c Fix up end of file and trailing whitespace. 2020-06-03 10:56:35 +01:00
__init__.h Fix up end of file and trailing whitespace. 2020-06-03 10:56:35 +01:00