Commit Graph

3 Commits

Author SHA1 Message Date
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 32f85f7a44 vectorio: fix up Rectangle
* Fix drawing 1 pixel too large
* Need to pad dirty area to ensure removed shapes are fully removed
2020-05-10 16:21:07 -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