circuitpython/shared-bindings/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 contains(x, y) 2021-12-27 12:01:19 -10:00
Circle.h vectorio: add draw protocol 2021-08-02 20:19:54 -07:00
Polygon.c vectorio contains(x, y) 2021-12-27 12:01:19 -10:00
Polygon.h vectorio: add draw protocol 2021-08-02 20:19:54 -07:00
Rectangle.c vectorio contains(x, y) 2021-12-27 12:01:19 -10: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 vectorio contains(x, y) 2021-12-27 12:01:19 -10:00
__init__.c Update the docs for vectorio 2021-09-11 23:37:41 +01:00
__init__.h Update __init__.h 2021-08-03 09:20:02 -07:00