UNPKG

fabric

Version:

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

1 lines 1.53 kB
{"version":3,"file":"FixedLayout.mjs","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"],"names":["FixedLayout","LayoutStrategy","getInitialSize","_ref","_ref2","target","size","Point","width","x","height","y","_defineProperty","classRegistry","setClass"],"mappings":";;;;;AASA;AACA;AACA;AACO,MAAMA,WAAW,SAASC,cAAc,CAAC;AAG9C;AACF;AACA;AACEC,EAAAA,cAAcA,CAAAC,IAAA,EAAAC,KAAA,EAGL;IAAA,IAFP;AAAEC,MAAAA,MAAAA;AAA0D,KAAC,GAAAF,IAAA,CAAA;IAAA,IAC7D;AAAEG,MAAAA,IAAAA;AAAoD,KAAC,GAAAF,KAAA,CAAA;AAEvD,IAAA,OAAO,IAAIG,KAAK,CAACF,MAAM,CAACG,KAAK,IAAIF,IAAI,CAACG,CAAC,EAAEJ,MAAM,CAACK,MAAM,IAAIJ,IAAI,CAACK,CAAC,CAAC,CAAA;AACnE,GAAA;AACF,CAAA;AAACC,eAAA,CAZYZ,WAAW,EAAA,MAAA,EACC,OAAO,CAAA,CAAA;AAahCa,aAAa,CAACC,QAAQ,CAACd,WAAW,CAAC;;;;"}