shapes
shapes
Mojo package 🡭
shapes
Modules
arcs: Arc/pie-wedge/ring-sector drawing: outline (draw_arc/draw_arc_aa, built by sampling the arc into points and handing them to canvas.shapes.lines’ draw_polyline/draw_polyline_aa), solid wedge/ring fill (fill_arc/fill_ring_sector, built the same way via canvas.shapes.polygon_fill’s fill_polygon), and their supersampled analytic-coverage AA counterparts (fill_arc_aa/ fill_ring_sector_aa) – see canvas.shapes.lines for the hard-edged vs._aanaming convention this follows.circles: Circle drawing: midpoint-algorithm hard-edged outline/fill (draw_circle/fill_circle) and exact-area anti-aliased variants (draw_circle_aa/fill_circle_aa) – see canvas.shapes.lines for the hard-edged vs._aanaming convention this follows.dash: Dash-pattern phase logic – shared by every stroked shape in canvas.shapes (lines, polylines/polygons, and indirectly arcs via draw_polyline/draw_polyline_aa). Split into its own file since it has no dependency on Canvas or any shape’s geometry, unlike every other file in this subpackage – see canvas.shapes.lines for the hard-edged vs._aanaming convention every file here follows.ellipses: Ellipse drawing: midpoint-algorithm hard-edged outline/fill (draw_ellipse/fill_ellipse, independent-x/y-radii generalizations of canvas.shapes.circles’ draw_circle/fill_circle) and supersampled analytic-coverage anti-aliased variants (draw_ellipse_aa/ fill_ellipse_aa) – see canvas.shapes.lines for the hard-edged vs._aanaming convention this follows.lines: Line, polyline, and polygon-outline drawing: Bresenham hard-edged (draw_line/draw_polyline/draw_polygon), supersampled analytic-coverage anti-aliased (draw_line_aa/draw_polyline_aa/draw_polygon_aa), and the dash-aware cores they share (_draw_line_core, _draw_polyline_core_aa).mesh: A mesh of adjacent faces drawn as one shape: full coverage wherever two faces meet, anti-aliasing only at the outer silhouette.polygon_fill: A polygon’s interior fill: the scanline/winding-number machinery (_Crossing,_Span,_spans_from_crossings), its two consumers here (fill_polygon,fill_polygon_aa), and_point_in_polygon, the real-valued membership test the anti-aliased sweep is checked against.rects: Rectangle drawing: stroked outline (draw_rect, via canvas.shapes.lines.draw_line), solid fill (fill_rect), and gradient-sourced fill (fill_rect_gradient/fill_rect_radial_gradient – see gradient.mojo) and pattern-sourced fill (fill_rect_pattern – see pattern.mojo).