UNPKG

fabric

Version:

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

2 lines 1.28 kB
import{_defineProperty as e}from"../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.min.mjs";import{classRegistry as t}from"../../ClassRegistry.min.mjs";import{Point as n}from"../../Point.min.mjs";import{makeBoundingBoxFromPoints as r}from"../../util/misc/boundingBoxFromPoints.min.mjs";import{sendPointToPlane as i}from"../../util/misc/planeChange.min.mjs";import{getObjectBounds as a}from"./utils.min.mjs";import{LayoutStrategy as o}from"./LayoutStrategy.min.mjs";var s=class extends o{shouldPerformLayout(e){return!!e.target.clipPath&&super.shouldPerformLayout(e)}shouldLayoutClipPath(){return!1}calcLayoutResult(e,t){let{target:o}=e,{clipPath:s,group:c}=o;if(!s||!this.shouldPerformLayout(e))return;let{width:l,height:u}=r(a(o,s)),d=new n(l,u);if(s.absolutePositioned)return{center:i(s.getRelativeCenterPoint(),void 0,c?c.calcTransformMatrix():void 0),size:d};{let r=s.getRelativeCenterPoint().transform(o.calcOwnMatrix(),!0);if(this.shouldPerformLayout(e)){let{center:i=new n,correction:a=new n}=this.calcBoundingBox(t,e)||{};return{center:i.add(r),correction:a.subtract(r),size:d}}return{center:o.getRelativeCenterPoint().add(r),size:d}}}};e(s,`type`,`clip-path`),t.setClass(s);export{s as ClipPathLayout}; //# sourceMappingURL=ClipPathLayout.min.mjs.map