Commit Graph

12 Commits

Author SHA1 Message Date
Scott Shawcroft
76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
Kevin Matocha
56362a9806 remove duplicated code, replace with displayio_area_canon 2021-03-25 11:31:07 -05:00
Kevin Matocha
9485805b6a move to displayio_area_union and away from _expand 2021-03-25 11:21:39 -05:00
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Dan Halbert
d1184e7e94 Be cognizant of null transform for .transpose_xy 2021-03-04 14:40:50 -05:00
Kenny
e977b427aa vectorio: fix VectorShape non-transposed pixel placement
Fixes https://github.com/adafruit/circuitpython/issues/3170

The absolute transform needs to be subtracted in all cases, not
only when the coordinate system is transposed.
2020-07-20 20:25:31 -07:00
Diego Elio Pettenò
dd5d7c86d2 Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-03 10:56:35 +01:00
warriorofwire
fd94c08cf4 add performance measurement to VectorShape 2020-05-12 11:49:15 -07:00
warriorofwire
58c8e00745 vectorio: clean up after group removal
VectorShape tells the Group to redraw whatever it left behind when it is removed now.
2020-05-10 15:36:23 -07:00
warriorofwire
6660311a96 vectorio: respect display transpose and mirror.
VectorShape now just uses the Group's and Display's absolute transforms.
2020-05-10 14:18:13 -07:00
warriorofwire
4086600b61 vectorio: switch per-shape transform to Display
Rather than maintain a transform per-shape, we'll just use whatever
  settings are on the Display.  Currently only transpose is done.
2020-05-09 22:15:51 -07:00
warriorofwire
206d0e598a Add vectorio: for drawing shapes
vectorio builds on m4 express feather

Concrete shapes are composed into a VectorShape which is put into a displayio Group for display.

VectorShape provides transpose and x/y positioning for shape implementations.

Included Shapes:

* Circle
  - A radius; Circle is positioned at its axis in the VectorShape.
  - You can freely modify the radius to grow and shrink the circle in-place.

* Polygon
  - An ordered list of points.
  - Beteween each successive point an edge is inferred.  A final edge closing the shape is inferred between the last
    point and the first point.
  - You can modify the points in a Polygon.  The points' coordinate system is relative to (0, 0) so if you'd like a
      top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (0, 20)] and your VectorShape
      x and y properties will position the rectangle relative to its top center point

* Rectangle
  A width and a height.
2020-05-09 15:38:22 -07:00