UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

22 lines (18 loc) 582 B
import type { StrictLayoutContext } from '../types'; import { LayoutStrategy } from './LayoutStrategy'; import { classRegistry } from '../../ClassRegistry'; /** * Layout will adjust the bounding box to fit target's objects. */ export class FitContentLayout extends LayoutStrategy { static readonly type = 'fit-content'; /** * @override layout on all triggers * Override at will */ // eslint-disable-next-line @typescript-eslint/no-unused-vars shouldPerformLayout(context: StrictLayoutContext) { return true; } } classRegistry.setClass(FitContentLayout);