summaryrefslogtreecommitdiff
path: root/shared-module/vectorio
AgeCommit message (Collapse)Author
2020-07-28use top-left heuristic for vectorio.PolygonKenny
this flips the bottom-right style to top-left which is at least kind of normal. A 2x2 square at (0,0) would be defined like (0,0), (3,0), (3,3), (0,3) Which seems kind of surprising but at least less bonkers than that square being defined at (1,1), which is the current behavior.
2020-07-20vectorio: fix VectorShape non-transposed pixel placementKenny
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-20pre-allocate list of known sizeKenny
2020-07-19fix 3169: Polygon.points propertyKenny
The getter for vectorio.Polygon#points was not updated with the data type change of the stored points list. This moves the implementation to shared_module and updates the data type to reflect the actual state.
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-05-18remove a duplication in polygon.cwarriorofwire
2020-05-18vectorio: speed up polygonwarriorofwire
This change takes polygon from 126k pixels per second fill to 240k pps fill on a reference 5 point star 50x66px polygon, updating both location and shape at 10hz. Tested on an m4 express feather. As a curiosity, the flat-out fill rate of a shape whose get_pixel is `return 0;` fills just shy of 375k pixels per second.
2020-05-12add performance measurement to VectorShapewarriorofwire
2020-05-12make Circle return explicitwarriorofwire
2020-05-10vectorio: fix up Rectanglewarriorofwire
* Fix drawing 1 pixel too large * Need to pad dirty area to ensure removed shapes are fully removed
2020-05-10vectorio: clean up after group removalwarriorofwire
VectorShape tells the Group to redraw whatever it left behind when it is removed now.
2020-05-10vectorio: respect display transpose and mirror.warriorofwire
VectorShape now just uses the Group's and Display's absolute transforms.
2020-05-09vectorio: switch per-shape transform to Displaywarriorofwire
Rather than maintain a transform per-shape, we'll just use whatever settings are on the Display. Currently only transpose is done.
2020-05-09Add vectorio: for drawing shapeswarriorofwire
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.