Skip to content
This is the alpha v4 version website. Looking for the v3 documentation?

packItemsOnPage

packItemsOnPage(items, ctx, cursor, margin?): object

Defined in: packages/sigma/src/utils/shelf-atlas.ts:50

Packs as many items as possible into a single canvas using a shelf (row) algorithm. Items that don’t fit are returned in remaining.

Parameters

items

PackableItem[]

ctx

CanvasRenderingContext2D

cursor

ShelfCursor

margin?

number = MARGIN

Returns

object

atlas

atlas: AtlasLookup

cursor

cursor: ShelfCursor

remaining

remaining: PackableItem[]