@mocanvas/editor · interface
interface AssetContextHow an asset is about to be used, so a store can serve a resolution- or bandwidth-appropriate variant instead of always handing back the original.
Every field has a sensible value in DEFAULT_ASSET_CONTEXT, so a store that only ever returns one URL can ignore the whole object.
Properties · 5
dpr: numberdevicePixelRatio of the surface the asset will be painted on.
networkEffectiveType: string | nullnavigator.connection.effectiveType when the browser reports it, otherwise null.
screenScale: numberHow large one page unit is on screen right now: camera zoom times device pixel ratio.
shouldResolveToOriginal: booleanTrue for copy, paste and export, where a downscaled variant would lose data.
steppedScreenScale: numberscreenScale snapped to a power of two, so a drag-resize does not re-request every frame.
Mentioned here
mocanvas 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.