Ir al contenido

PathCache

Defined in: render/RenderCache.ts:9

A cache for complex shape paths as Path2D objects. Building a Path2D for complex shapes (diamond, star, etc.) is expensive; caching them avoids recomputation each frame.

new PathCache(): PathCache

PathCache

get size(): number

Defined in: render/RenderCache.ts:14

Get the number of cached paths.

number

clear(): void

Defined in: render/RenderCache.ts:66

Clear the path cache.

void


getPath(type, width, height): Path2D | null

Defined in: render/RenderCache.ts:22

Get (or build) a cached Path2D for a shape type at a given size. The key includes the size because the shape geometry depends on it.

ShapeType

number

number

Path2D | null