UNPKG

fabric

Version:

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

1 lines 1.07 kB
{"version":3,"file":"FixedLayout.mjs","names":[],"sources":["../../../../src/LayoutManager/LayoutStrategies/FixedLayout.ts"],"sourcesContent":["import { Point } from '../../Point';\nimport type {\n InitializationLayoutContext,\n LayoutStrategyResult,\n StrictLayoutContext,\n} from '../types';\nimport { LayoutStrategy } from './LayoutStrategy';\nimport { classRegistry } from '../../ClassRegistry';\n\n/**\n * Layout will keep target's initial size.\n */\nexport class FixedLayout extends LayoutStrategy {\n static readonly type = 'fixed';\n\n /**\n * @override respect target's initial size\n */\n getInitialSize(\n { target }: StrictLayoutContext & InitializationLayoutContext,\n { size }: Pick<LayoutStrategyResult, 'center' | 'size'>,\n ): Point {\n return new Point(target.width || size.x, target.height || size.y);\n }\n}\n\nclassRegistry.setClass(FixedLayout);\n"],"mappings":";;;;;;;;AAYA,IAAa,cAAb,cAAiC,eAAe;;;;CAM9C,eACE,EAAE,UACF,EAAE,QACK;AACP,SAAO,IAAI,MAAM,OAAO,SAAS,KAAK,GAAG,OAAO,UAAU,KAAK,EAAE;;;6BATnD,QAAO,QAAQ;AAajC,cAAc,SAAS,YAAY"}