@mocanvas/editor · class
declare class Stadium2d extends Geometry2dA rectangle with fully rounded ends — a pill. The shorter axis decides the radius, so a square stadium is a circle.
SEMANTICS-ASSUMED: the docs give only { width, height }. Rounding the
shorter axis completely is what makes the name "stadium" true at every aspect
ratio, and is the only rule under which the shape degenerates sensibly.
Methods · 6
constructor(config: Flags & {getBounds(): BoxgetLength(): numbergetVertices(): Vec[]get radius(): numberThe radius of the rounded ends.
toPathWords(): number[]Properties · 2
readonly h: numberreadonly w: numbermocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.