Skip to content

Refactor: Canvas Rendering Optimization for Large Boards #46

Description

@Pranav00076

Description:
When the board exceeds 500+ shapes, panning and zooming might begin to drop frames.

How to Implement:

  1. Object Caching: Set fabric.Object.prototype.objectCaching = true. This forces Fabric to render complex shapes to an offscreen canvas first.
  2. Render Throttling: Ensure you aren't calling canvas.renderAll() excessively during Yjs updates. Wrap bulk updates in a single requestAnimationFrame.
  3. Viewport Culling: (Advanced) Override the native rendering loop or selectively hide (visible: false) objects whose bounding boxes do not intersect with the current canvas.vptCoords bounding box to save GPU resources.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions