@mocanvas/mocanvas · class
declare abstract class BaseBrushOverlayUtil<T extends TLBrushOverlay | TLZoomBrushOverlay> extends OverlayUtil<Editor, BrushOverlayUtilOptions>The half a brush painter shares with the other one: read a rectangle off the instance record, name it, stroke it in page space.
Generic in its overlay record so the two concrete utils can each declare
their own — a caller that asked editor.overlays.getOverlayUtil("zoomBrush")
for its overlays gets TLZoomBrushOverlay[], not the union.
Methods · 6
protected abstract getBrushBounds(): OverlayBox | nullThe brush rectangle, or null when no drag is in flight.
getDisplayValues(): BrushOverlayUtilDisplayValuesThe colours to draw with, read fresh from the theme on every frame.
getGeometry(): Geometry2d | undefinedA brush is not pointable — it *is* the pointer gesture. Returning the rectangle would make the brush swallow the drag that draws it.
abstract getOverlays(): T[]isActive(): booleanrender(ctx: CanvasRenderingContext2D): voidmocanvas 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.