2 lines
1.0 KiB
JavaScript
2 lines
1.0 KiB
JavaScript
import t from"../../utils/extend.prod.js";import*as o from"../../utils/rect.prod.js";import{makeModifier as e}from"../base.prod.js";import{restrictEdges as i}from"./edges.prod.js";import{getRestrictionRect as r}from"./pointer.prod.js";const n={width:-1/0,height:-1/0},s={width:1/0,height:1/0},p={start:t=>i.start(t),set(e){const{interaction:p,state:h,rect:d,edges:l}=e,{options:m}=h;if(!l)return;const f=o.tlbrToXywh(r(m.min,p,e.coords))||n,g=o.tlbrToXywh(r(m.max,p,e.coords))||s;h.options={endOnly:m.endOnly,inner:t({},i.noInner),outer:t({},i.noOuter)},l.top?(h.options.inner.top=d.bottom-f.height,h.options.outer.top=d.bottom-g.height):l.bottom&&(h.options.inner.bottom=d.top+f.height,h.options.outer.bottom=d.top+g.height),l.left?(h.options.inner.left=d.right-f.width,h.options.outer.left=d.right-g.width):l.right&&(h.options.inner.right=d.left+f.width,h.options.outer.right=d.left+g.width),i.set(e),h.options=m},defaults:{min:null,max:null,endOnly:!1,enabled:!1}};export default e(p,"restrictSize");export{p as restrictSize};
|
|
//# sourceMappingURL=size.prod.js.map
|