@leafer-in/view 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/view.cjs +1 -0
- package/dist/view.cjs.map +1 -0
- package/dist/view.esm.js +1 -0
- package/dist/view.esm.js.map +1 -0
- package/dist/view.esm.min.js +1 -0
- package/dist/view.esm.min.js.map +1 -0
- package/dist/view.js +1 -0
- package/dist/view.js.map +1 -0
- package/dist/view.min.cjs +1 -0
- package/dist/view.min.cjs.map +1 -0
- package/dist/view.min.js +1 -0
- package/dist/view.min.js.map +1 -0
- package/package.json +8 -8
package/dist/view.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.cjs","sources":["../../../../../../src/in/packages/view/src/helper.ts","../../../../../../src/in/packages/view/src/index.ts"],"sourcesContent":["import { IBoundsData } from '@leafer-ui/interface'\n\n\nexport function getZoomScale(scaleX: number, type: 'in' | 'out'): number {\n let scale = 1\n const out = type === 'out', absScale = Math.abs(scaleX)\n if (absScale > 1) {\n while (out ? scale < absScale : scale <= absScale) scale *= 2\n if (out) scale /= 2\n } else {\n while (out ? scale >= absScale : scale > absScale) scale /= 2\n if (!out) scale *= 2\n }\n return scale / scaleX\n}\n\nexport function getFixBounds(bounds: IBoundsData, scaleBounds: IBoundsData): IBoundsData {\n let { x, y, width, height } = bounds\n let fix: boolean\n if (!height) height = width * (scaleBounds.height / scaleBounds.width), fix = true\n if (!width) width = height * (scaleBounds.width / scaleBounds.height), fix = true\n return fix ? { x, y, width, height } : bounds\n}","import { ILeaf, IBoundsData, IZoomType, IFourNumber, IPointData } from '@leafer-ui/interface'\nimport { Leafer, Bounds, LeafBoundsHelper, Plugin } from '@leafer-ui/draw'\n\nimport { getFixBounds, getZoomScale } from './helper'\n\n\nPlugin.add('view')\n\n\nLeafer.prototype.zoom = function (zoomType: IZoomType, padding?: IFourNumber, fixed?: boolean): IBoundsData {\n\n const { zoomLayer } = this\n const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds()\n const center: IPointData = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 }\n\n let changeScale: number\n const { scaleX } = this.__\n\n if (typeof zoomType === 'string') {\n\n switch (zoomType) {\n case 'in':\n changeScale = getZoomScale(scaleX, 'in')\n break\n case 'out':\n changeScale = getZoomScale(scaleX, 'out')\n break\n case 'fit':\n zoomType = this.boxBounds\n break\n case 'fit-width':\n zoomType = new Bounds(this.boxBounds)\n zoomType.height = 0\n break\n case 'fit-height':\n zoomType = new Bounds(this.boxBounds)\n zoomType.width = 0\n break\n }\n\n } else if (typeof zoomType === 'number') {\n changeScale = zoomType / scaleX\n }\n\n\n if (changeScale) {\n\n if (changeScale !== 1) zoomLayer.scaleOfWorld(center, this.getValidScale(changeScale))\n\n } else if (typeof zoomType === 'object') {\n\n const isArray = zoomType instanceof Array\n\n if (isArray || (zoomType as ILeaf).tag) {\n const list: ILeaf[] = isArray ? zoomType as ILeaf[] : [zoomType as ILeaf]\n bounds.setListWithFn(list, LeafBoundsHelper.worldBounds)\n } else {\n const innerBounds = getFixBounds(zoomType as IBoundsData, limitBounds)\n bounds.set(zoomLayer.getWorldBounds(innerBounds))\n }\n\n const { x, y, width, height } = bounds\n let moveX = limitBounds.x - x, moveY = limitBounds.y - y\n\n if (fixed) {\n\n moveX += Math.max((limitBounds.width - width) / 2, 0)\n moveY += Math.max((limitBounds.height - height) / 2, 0)\n\n } else {\n\n const fitScale = this.getValidScale(Math.min(limitBounds.width / width, limitBounds.height / height))\n moveX += (limitBounds.width - width * fitScale) / 2\n moveY += (limitBounds.height - height * fitScale) / 2\n\n zoomLayer.scaleOfWorld(bounds, fitScale)\n bounds.scaleOf(bounds, fitScale)\n\n }\n\n zoomLayer.move(moveX, moveY)\n return bounds.move(moveX, moveY)\n\n }\n\n return zoomLayer.worldBoxBounds\n\n}"],"names":["Plugin","Leafer","Bounds","LeafBounds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KAAK,GAAG,QAAQ,IAAI,CAAC;AACnD,YAAA,KAAK,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,MAAM,GAAG,QAAQ,IAAI,CAAC;AAErD,YAAA,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;AACxC,YAAA,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAIpC,QAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;;IAIpC,OAAO,SAAS,CAAC,cAAc;AAEnC,CAAC;;"}
|
package/dist/view.esm.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.esm.js","sources":["../../../../../../src/in/packages/view/src/helper.ts","../../../../../../src/in/packages/view/src/index.ts"],"sourcesContent":["import { IBoundsData } from '@leafer-ui/interface'\n\n\nexport function getZoomScale(scaleX: number, type: 'in' | 'out'): number {\n let scale = 1\n const out = type === 'out', absScale = Math.abs(scaleX)\n if (absScale > 1) {\n while (out ? scale < absScale : scale <= absScale) scale *= 2\n if (out) scale /= 2\n } else {\n while (out ? scale >= absScale : scale > absScale) scale /= 2\n if (!out) scale *= 2\n }\n return scale / scaleX\n}\n\nexport function getFixBounds(bounds: IBoundsData, scaleBounds: IBoundsData): IBoundsData {\n let { x, y, width, height } = bounds\n let fix: boolean\n if (!height) height = width * (scaleBounds.height / scaleBounds.width), fix = true\n if (!width) width = height * (scaleBounds.width / scaleBounds.height), fix = true\n return fix ? { x, y, width, height } : bounds\n}","import { ILeaf, IBoundsData, IZoomType, IFourNumber, IPointData } from '@leafer-ui/interface'\nimport { Leafer, Bounds, LeafBoundsHelper, Plugin } from '@leafer-ui/draw'\n\nimport { getFixBounds, getZoomScale } from './helper'\n\n\nPlugin.add('view')\n\n\nLeafer.prototype.zoom = function (zoomType: IZoomType, padding?: IFourNumber, fixed?: boolean): IBoundsData {\n\n const { zoomLayer } = this\n const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds()\n const center: IPointData = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 }\n\n let changeScale: number\n const { scaleX } = this.__\n\n if (typeof zoomType === 'string') {\n\n switch (zoomType) {\n case 'in':\n changeScale = getZoomScale(scaleX, 'in')\n break\n case 'out':\n changeScale = getZoomScale(scaleX, 'out')\n break\n case 'fit':\n zoomType = this.boxBounds\n break\n case 'fit-width':\n zoomType = new Bounds(this.boxBounds)\n zoomType.height = 0\n break\n case 'fit-height':\n zoomType = new Bounds(this.boxBounds)\n zoomType.width = 0\n break\n }\n\n } else if (typeof zoomType === 'number') {\n changeScale = zoomType / scaleX\n }\n\n\n if (changeScale) {\n\n if (changeScale !== 1) zoomLayer.scaleOfWorld(center, this.getValidScale(changeScale))\n\n } else if (typeof zoomType === 'object') {\n\n const isArray = zoomType instanceof Array\n\n if (isArray || (zoomType as ILeaf).tag) {\n const list: ILeaf[] = isArray ? zoomType as ILeaf[] : [zoomType as ILeaf]\n bounds.setListWithFn(list, LeafBoundsHelper.worldBounds)\n } else {\n const innerBounds = getFixBounds(zoomType as IBoundsData, limitBounds)\n bounds.set(zoomLayer.getWorldBounds(innerBounds))\n }\n\n const { x, y, width, height } = bounds\n let moveX = limitBounds.x - x, moveY = limitBounds.y - y\n\n if (fixed) {\n\n moveX += Math.max((limitBounds.width - width) / 2, 0)\n moveY += Math.max((limitBounds.height - height) / 2, 0)\n\n } else {\n\n const fitScale = this.getValidScale(Math.min(limitBounds.width / width, limitBounds.height / height))\n moveX += (limitBounds.width - width * fitScale) / 2\n moveY += (limitBounds.height - height * fitScale) / 2\n\n zoomLayer.scaleOfWorld(bounds, fitScale)\n bounds.scaleOf(bounds, fitScale)\n\n }\n\n zoomLayer.move(moveX, moveY)\n return bounds.move(moveX, moveY)\n\n }\n\n return zoomLayer.worldBoxBounds\n\n}"],"names":[],"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,IAAI,CAAC;AACnD,YAAA,KAAK,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,MAAM,GAAG,QAAQ,IAAI,CAAC;AAErD,YAAA,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC;AACxC,YAAA,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAIpC,QAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;;IAIpC,OAAO,SAAS,CAAC,cAAc;AAEnC,CAAC"}
|
package/dist/view.esm.min.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
import{Plugin as t,Leafer as e,Bounds as i,LeafBoundsHelper as o}from"@leafer-ui/draw";function h(t,e){let i=1;const o="out"===e,h=Math.abs(t);if(h>1){for(;o?i<h:i<=h;)i*=2;o&&(i/=2)}else{for(;o?i>=h:i>h;)i/=2;o||(i*=2)}return i/t}t.add("view"),e.prototype.zoom=function(t,e,s){const{zoomLayer:n}=this,a=this.canvas.bounds.clone().shrink(void 0!==e?e:30),r=new i,d={x:a.x+a.width/2,y:a.y+a.height/2};let c;const{scaleX:l}=this.__;if("string"==typeof t)switch(t){case"in":c=h(l,"in");break;case"out":c=h(l,"out");break;case"fit":t=this.boxBounds;break;case"fit-width":(t=new i(this.boxBounds)).height=0;break;case"fit-height":(t=new i(this.boxBounds)).width=0}else"number"==typeof t&&(c=t/l);if(c)1!==c&&n.scaleOfWorld(d,this.getValidScale(c));else if("object"==typeof t){const e=t instanceof Array;if(e||t.tag){const i=e?t:[t];r.setListWithFn(i,o.worldBounds)}else{const e=function(t,e){let i,{x:o,y:h,width:s,height:n}=t;return n||(n=s*(e.height/e.width),i=!0),s||(s=n*(e.width/e.height),i=!0),i?{x:o,y:h,width:s,height:n}:t}(t,a);r.set(n.getWorldBounds(e))}const{x:i,y:h,width:d,height:c}=r;let l=a.x-i,f=a.y-h;if(s)l+=Math.max((a.width-d)/2,0),f+=Math.max((a.height-c)/2,0);else{const t=this.getValidScale(Math.min(a.width/d,a.height/c));l+=(a.width-d*t)/2,f+=(a.height-c*t)/2,n.scaleOfWorld(r,t),r.scaleOf(r,t)}return n.move(l,f),r.move(l,f)}return n.worldBoxBounds};
|
|
2
|
+
//# sourceMappingURL=view.esm.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.esm.min.js","sources":["../../../../../../src/in/packages/view/src/helper.ts","../../../../../../src/in/packages/view/src/index.ts"],"sourcesContent":["import { IBoundsData } from '@leafer-ui/interface'\n\n\nexport function getZoomScale(scaleX: number, type: 'in' | 'out'): number {\n let scale = 1\n const out = type === 'out', absScale = Math.abs(scaleX)\n if (absScale > 1) {\n while (out ? scale < absScale : scale <= absScale) scale *= 2\n if (out) scale /= 2\n } else {\n while (out ? scale >= absScale : scale > absScale) scale /= 2\n if (!out) scale *= 2\n }\n return scale / scaleX\n}\n\nexport function getFixBounds(bounds: IBoundsData, scaleBounds: IBoundsData): IBoundsData {\n let { x, y, width, height } = bounds\n let fix: boolean\n if (!height) height = width * (scaleBounds.height / scaleBounds.width), fix = true\n if (!width) width = height * (scaleBounds.width / scaleBounds.height), fix = true\n return fix ? { x, y, width, height } : bounds\n}","import { ILeaf, IBoundsData, IZoomType, IFourNumber, IPointData } from '@leafer-ui/interface'\nimport { Leafer, Bounds, LeafBoundsHelper, Plugin } from '@leafer-ui/draw'\n\nimport { getFixBounds, getZoomScale } from './helper'\n\n\nPlugin.add('view')\n\n\nLeafer.prototype.zoom = function (zoomType: IZoomType, padding?: IFourNumber, fixed?: boolean): IBoundsData {\n\n const { zoomLayer } = this\n const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds()\n const center: IPointData = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 }\n\n let changeScale: number\n const { scaleX } = this.__\n\n if (typeof zoomType === 'string') {\n\n switch (zoomType) {\n case 'in':\n changeScale = getZoomScale(scaleX, 'in')\n break\n case 'out':\n changeScale = getZoomScale(scaleX, 'out')\n break\n case 'fit':\n zoomType = this.boxBounds\n break\n case 'fit-width':\n zoomType = new Bounds(this.boxBounds)\n zoomType.height = 0\n break\n case 'fit-height':\n zoomType = new Bounds(this.boxBounds)\n zoomType.width = 0\n break\n }\n\n } else if (typeof zoomType === 'number') {\n changeScale = zoomType / scaleX\n }\n\n\n if (changeScale) {\n\n if (changeScale !== 1) zoomLayer.scaleOfWorld(center, this.getValidScale(changeScale))\n\n } else if (typeof zoomType === 'object') {\n\n const isArray = zoomType instanceof Array\n\n if (isArray || (zoomType as ILeaf).tag) {\n const list: ILeaf[] = isArray ? zoomType as ILeaf[] : [zoomType as ILeaf]\n bounds.setListWithFn(list, LeafBoundsHelper.worldBounds)\n } else {\n const innerBounds = getFixBounds(zoomType as IBoundsData, limitBounds)\n bounds.set(zoomLayer.getWorldBounds(innerBounds))\n }\n\n const { x, y, width, height } = bounds\n let moveX = limitBounds.x - x, moveY = limitBounds.y - y\n\n if (fixed) {\n\n moveX += Math.max((limitBounds.width - width) / 2, 0)\n moveY += Math.max((limitBounds.height - height) / 2, 0)\n\n } else {\n\n const fitScale = this.getValidScale(Math.min(limitBounds.width / width, limitBounds.height / height))\n moveX += (limitBounds.width - width * fitScale) / 2\n moveY += (limitBounds.height - height * fitScale) / 2\n\n zoomLayer.scaleOfWorld(bounds, fitScale)\n bounds.scaleOf(bounds, fitScale)\n\n }\n\n zoomLayer.move(moveX, moveY)\n return bounds.move(moveX, moveY)\n\n }\n\n return zoomLayer.worldBoxBounds\n\n}"],"names":["getZoomScale","scaleX","type","scale","out","absScale","Math","abs","Plugin","add","Leafer","prototype","zoom","zoomType","padding","fixed","zoomLayer","this","limitBounds","canvas","bounds","clone","shrink","undefined","Bounds","center","x","width","y","height","changeScale","__","boxBounds","scaleOfWorld","getValidScale","isArray","Array","tag","list","setListWithFn","LeafBoundsHelper","worldBounds","innerBounds","scaleBounds","fix","getFixBounds","set","getWorldBounds","moveX","moveY","max","fitScale","min","scaleOf","move","worldBoxBounds"],"mappings":"uFAGgB,SAAAA,EAAaC,EAAgBC,GACzC,IAAIC,EAAQ,EACZ,MAAMC,EAAe,QAATF,EAAgBG,EAAWC,KAAKC,IAAIN,GAChD,GAAII,EAAW,EAAG,CACd,KAAOD,EAAMD,EAAQE,EAAWF,GAASE,GAAUF,GAAS,EACxDC,IAAKD,GAAS,OACf,CACH,KAAOC,EAAMD,GAASE,EAAWF,EAAQE,GAAUF,GAAS,EACvDC,IAAKD,GAAS,GAEvB,OAAOA,EAAQF,CACnB,CCRAO,EAAOC,IAAI,QAGXC,EAAOC,UAAUC,KAAO,SAAUC,EAAqBC,EAAuBC,GAE1E,MAAMC,UAAEA,GAAcC,KAChBC,EAAcD,KAAKE,OAAOC,OAAOC,QAAQC,YAAmBC,IAAZT,EAAwBA,EAAU,IAAKM,EAAS,IAAII,EACpGC,EAAqB,CAAEC,EAAGR,EAAYQ,EAAIR,EAAYS,MAAQ,EAAGC,EAAGV,EAAYU,EAAIV,EAAYW,OAAS,GAE/G,IAAIC,EACJ,MAAM7B,OAAEA,GAAWgB,KAAKc,GAExB,GAAwB,iBAAblB,EAEP,OAAQA,GACJ,IAAK,KACDiB,EAAc9B,EAAaC,EAAQ,MACnC,MACJ,IAAK,MACD6B,EAAc9B,EAAaC,EAAQ,OACnC,MACJ,IAAK,MACDY,EAAWI,KAAKe,UAChB,MACJ,IAAK,aACDnB,EAAW,IAAIW,EAAOP,KAAKe,YAClBH,OAAS,EAClB,MACJ,IAAK,cACDhB,EAAW,IAAIW,EAAOP,KAAKe,YAClBL,MAAQ,MAIE,iBAAbd,IACdiB,EAAcjB,EAAWZ,GAI7B,GAAI6B,EAEoB,IAAhBA,GAAmBd,EAAUiB,aAAaR,EAAQR,KAAKiB,cAAcJ,SAEtE,GAAwB,iBAAbjB,EAAuB,CAErC,MAAMsB,EAAUtB,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ources":["../../../../../../src/in/packages/view/src/helper.ts","../../../../../../src/in/packages/view/src/index.ts"],"sourcesContent":["import { IBoundsData } from '@leafer-ui/interface'\n\n\nexport function getZoomScale(scaleX: number, type: 'in' | 'out'): number {\n let scale = 1\n const out = type === 'out', absScale = Math.abs(scaleX)\n if (absScale > 1) {\n while (out ? scale < absScale : scale <= absScale) scale *= 2\n if (out) scale /= 2\n } else {\n while (out ? scale >= absScale : scale > absScale) scale /= 2\n if (!out) scale *= 2\n }\n return scale / scaleX\n}\n\nexport function getFixBounds(bounds: IBoundsData, scaleBounds: IBoundsData): IBoundsData {\n let { x, y, width, height } = bounds\n let fix: boolean\n if (!height) height = width * (scaleBounds.height / scaleBounds.width), fix = true\n if (!width) width = height * (scaleBounds.width / scaleBounds.height), fix = true\n return fix ? { x, y, width, height } : bounds\n}","import { ILeaf, IBoundsData, IZoomType, IFourNumber, IPointData } from '@leafer-ui/interface'\nimport { Leafer, Bounds, LeafBoundsHelper, Plugin } from '@leafer-ui/draw'\n\nimport { getFixBounds, getZoomScale } from './helper'\n\n\nPlugin.add('view')\n\n\nLeafer.prototype.zoom = function (zoomType: IZoomType, padding?: IFourNumber, fixed?: boolean): IBoundsData {\n\n const { zoomLayer } = this\n const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds()\n const center: IPointData = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 }\n\n let changeScale: number\n const { scaleX } = this.__\n\n if (typeof zoomType === 'string') {\n\n switch (zoomType) {\n case 'in':\n changeScale = getZoomScale(scaleX, 'in')\n break\n case 'out':\n changeScale = getZoomScale(scaleX, 'out')\n break\n case 'fit':\n zoomType = this.boxBounds\n break\n case 'fit-width':\n zoomType = new Bounds(this.boxBounds)\n zoomType.height = 0\n break\n case 'fit-height':\n zoomType = new Bounds(this.boxBounds)\n zoomType.width = 0\n break\n }\n\n } else if (typeof zoomType === 'number') {\n changeScale = zoomType / scaleX\n }\n\n\n if (changeScale) {\n\n if (changeScale !== 1) zoomLayer.scaleOfWorld(center, this.getValidScale(changeScale))\n\n } else if (typeof zoomType === 'object') {\n\n const isArray = zoomType instanceof Array\n\n if (isArray || (zoomType as ILeaf).tag) {\n const list: ILeaf[] = isArray ? zoomType as ILeaf[] : [zoomType as ILeaf]\n bounds.setListWithFn(list, LeafBoundsHelper.worldBounds)\n } else {\n const innerBounds = getFixBounds(zoomType as IBoundsData, limitBounds)\n bounds.set(zoomLayer.getWorldBounds(innerBounds))\n }\n\n const { x, y, width, height } = bounds\n let moveX = limitBounds.x - x, moveY = limitBounds.y - y\n\n if (fixed) {\n\n moveX += Math.max((limitBounds.width - width) / 2, 0)\n moveY += Math.max((limitBounds.height - height) / 2, 0)\n\n } else {\n\n const fitScale = this.getValidScale(Math.min(limitBounds.width / width, limitBounds.height / height))\n moveX += (limitBounds.width - width * fitScale) / 2\n moveY += (limitBounds.height - height * fitScale) / 2\n\n zoomLayer.scaleOfWorld(bounds, fitScale)\n bounds.scaleOf(bounds, fitScale)\n\n }\n\n zoomLayer.move(moveX, moveY)\n return bounds.move(moveX, moveY)\n\n }\n\n return zoomLayer.worldBoxBounds\n\n}"],"names":["Plugin","Leafer","Bounds","LeafBoundsHelper"],"mappings":";;;IAGgB,SAAA,YAAY,CAAC,MAAc,EAAE,IAAkB,EAAA;QAC3D,IAAI,KAAK,GAAG,CAAC;IACb,IAAA,MAAM,GAAG,GAAG,IAAI,KAAK,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;IACvD,IAAA,IAAI,QAAQ,GAAG,CAAC,EAAE;IACd,QAAA,OAAO,GAAG,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,IAAI,QAAQ;gBAAE,KAAK,IAAI,CAAC;IAC7D,QAAA,IAAI,GAAG;gBAAE,KAAK,IAAI,CAAC;;aAChB;IACH,QAAA,OAAO,GAAG,GAAG,KAAK,IAAI,QAAQ,GAAG,KAAK,GAAG,QAA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 @@
|
|
|
1
1
|
"use strict";var t=require("@leafer-ui/draw");function e(t,e){let i=1;const s="out"===e,o=Math.abs(t);if(o>1){for(;s?i<o:i<=o;)i*=2;s&&(i/=2)}else{for(;s?i>=o:i>o;)i/=2;s||(i*=2)}return i/t}t.Plugin.add("view"),t.Leafer.prototype.zoom=function(i,s,o){const{zoomLayer:h}=this,n=this.canvas.bounds.clone().shrink(void 0!==s?s:30),a=new t.Bounds,r={x:n.x+n.width/2,y:n.y+n.height/2};let d;const{scaleX:c}=this.__;if("string"==typeof i)switch(i){case"in":d=e(c,"in");break;case"out":d=e(c,"out");break;case"fit":i=this.boxBounds;break;case"fit-width":(i=new t.Bounds(this.boxBounds)).height=0;break;case"fit-height":(i=new t.Bounds(this.boxBounds)).width=0}else"number"==typeof i&&(d=i/c);if(d)1!==d&&h.scaleOfWorld(r,this.getValidScale(d));else if("object"==typeof i){const e=i instanceof Array;if(e||i.tag){const s=e?i:[i];a.setListWithFn(s,t.LeafBoundsHelper.worldBounds)}else{const t=function(t,e){let i,{x:s,y:o,width:h,height:n}=t;return n||(n=h*(e.height/e.width),i=!0),h||(h=n*(e.width/e.height),i=!0),i?{x:s,y:o,width:h,height:n}:t}(i,n);a.set(h.getWorldBounds(t))}const{x:s,y:r,width:d,height:c}=a;let l=n.x-s,u=n.y-r;if(o)l+=Math.max((n.width-d)/2,0),u+=Math.max((n.height-c)/2,0);else{const t=this.getValidScale(Math.min(n.width/d,n.height/c));l+=(n.width-d*t)/2,u+=(n.height-c*t)/2,h.scaleOfWorld(a,t),a.scaleOf(a,t)}return h.move(l,u),a.move(l,u)}return h.worldBoxBounds};
|
|
2
|
+
//# sourceMappingURL=view.min.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.min.cjs","sources":["../../../../../../src/in/packages/view/src/helper.ts","../../../../../../src/in/packages/view/src/index.ts"],"sourcesContent":["import { IBoundsData } from '@leafer-ui/interface'\n\n\nexport function getZoomScale(scaleX: number, type: 'in' | 'out'): number {\n let scale = 1\n const out = type === 'out', absScale = Math.abs(scaleX)\n if (absScale > 1) {\n while (out ? scale < absScale : scale <= absScale) scale *= 2\n if (out) scale /= 2\n } else {\n while (out ? scale >= absScale : scale > absScale) scale /= 2\n if (!out) scale *= 2\n }\n return scale / scaleX\n}\n\nexport function getFixBounds(bounds: IBoundsData, scaleBounds: IBoundsData): IBoundsData {\n let { x, y, width, height } = bounds\n let fix: boolean\n if (!height) height = width * (scaleBounds.height / scaleBounds.width), fix = true\n if (!width) width = height * (scaleBounds.width / scaleBounds.height), fix = true\n return fix ? { x, y, width, height } : bounds\n}","import { ILeaf, IBoundsData, IZoomType, IFourNumber, IPointData } from '@leafer-ui/interface'\nimport { Leafer, Bounds, LeafBoundsHelper, Plugin } from '@leafer-ui/draw'\n\nimport { getFixBounds, getZoomScale } from './helper'\n\n\nPlugin.add('view')\n\n\nLeafer.prototype.zoom = function (zoomType: IZoomType, padding?: IFourNumber, fixed?: boolean): IBoundsData {\n\n const { zoomLayer } = this\n const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds()\n const center: IPointData = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 }\n\n let changeScale: number\n const { scaleX } = this.__\n\n if (typeof zoomType === 'string') {\n\n switch (zoomType) {\n case 'in':\n changeScale = getZoomScale(scaleX, 'in')\n break\n case 'out':\n changeScale = getZoomScale(scaleX, 'out')\n break\n case 'fit':\n zoomType = this.boxBounds\n break\n case 'fit-width':\n zoomType = new Bounds(this.boxBounds)\n zoomType.height = 0\n break\n case 'fit-height':\n zoomType = new Bounds(this.boxBounds)\n zoomType.width = 0\n break\n }\n\n } else if (typeof zoomType === 'number') {\n changeScale = zoomType / scaleX\n }\n\n\n if (changeScale) {\n\n if (changeScale !== 1) zoomLayer.scaleOfWorld(center, this.getValidScale(changeScale))\n\n } else if (typeof zoomType === 'object') {\n\n const isArray = zoomType instanceof Array\n\n if (isArray || (zoomType as ILeaf).tag) {\n const list: ILeaf[] = isArray ? zoomType as ILeaf[] : [zoomType as ILeaf]\n bounds.setListWithFn(list, LeafBoundsHelper.worldBounds)\n } else {\n const innerBounds = getFixBounds(zoomType as IBoundsData, limitBounds)\n bounds.set(zoomLayer.getWorldBounds(innerBounds))\n }\n\n const { x, y, width, height } = bounds\n let moveX = limitBounds.x - x, moveY = limitBounds.y - y\n\n if (fixed) {\n\n moveX += Math.max((limitBounds.width - width) / 2, 0)\n moveY += Math.max((limitBounds.height - height) / 2, 0)\n\n } else {\n\n const fitScale = this.getValidScale(Math.min(limitBounds.width / width, limitBounds.height / height))\n moveX += (limitBounds.width - width * fitScale) / 2\n moveY += (limitBounds.height - height * fitScale) / 2\n\n zoomLayer.scaleOfWorld(bounds, fitScale)\n bounds.scaleOf(bounds, fitScale)\n\n }\n\n zoomLayer.move(moveX, moveY)\n return bounds.move(moveX, moveY)\n\n }\n\n return zoomLayer.worldBoxBounds\n\n}"],"names":["getZoomScale","scaleX","type","scale","out","absScale","Math","abs","Plugin","add","Leafer","prototype","zoom","zoomType","padding","fixed","zoomLayer","this","limitBounds","canvas","bounds","clone","shrink","undefined","Bounds","center","x","width","y","height","changeScale","__","boxBounds","scaleOfWorld","getValidScale","isArray","Array","tag","list","setListWithFn","LeafBoundsHelper","worldBounds","innerBounds","scaleBounds","fix","getFixBounds","set","getWorldBounds","moveX","moveY","max","fitScale","min","scaleOf","move","worldBoxBounds"],"mappings":"8CAGgB,SAAAA,EAAaC,EAAgBC,GACzC,IAAIC,EAAQ,EACZ,MAAMC,EAAe,QAATF,EAAgBG,EAAWC,KAAKC,IAAIN,GAChD,GAAII,EAAW,EAAG,CACd,KAAOD,EAAMD,EAAQE,EAAWF,GAASE,GAAUF,GAAS,EACxDC,IAAKD,GAAS,OACf,CACH,KAAOC,EAAMD,GAASE,EAAWF,EAAQE,GAAUF,GAAS,EACvDC,IAAKD,GAAS,GAEvB,OAAOA,EAAQF,CACnB,CCRAO,EAAA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ACtEA,EAAM,CAAElB,IAAGE,IAAGD,QAAOE,UAAWT,CAC3C,CCmCgCyB,CAAahC,EAAyBK,GAC1DE,EAAO0B,IAAI9B,EAAU+B,eAAeL,IAGxC,MAAMhB,EAAEA,EAACE,EAAEA,EAACD,MAAEA,EAAKE,OAAEA,GAAWT,EAChC,IAAI4B,EAAQ9B,EAAYQ,EAAIA,EAAGuB,EAAQ/B,EAAYU,EAAIA,EAEvD,GAAIb,EAEAiC,GAAS1C,KAAK4C,KAAKhC,EAAYS,MAAQA,GAAS,EAAG,GACnDsB,GAAS3C,KAAK4C,KAAKhC,EAAYW,OAASA,GAAU,EAAG,OAElD,CAEH,MAAMsB,EAAWlC,KAAKiB,cAAc5B,KAAK8C,IAAIlC,EAAYS,MAAQA,EAAOT,EAAYW,OAASA,IAC7FmB,IAAU9B,EAAYS,MAAQA,EAAQwB,GAAY,EAClDF,IAAU/B,EAAYW,OAASA,EAASsB,GAAY,EAEpDnC,EAAUiB,aAAab,EAAQ+B,GAC/B/B,EAAOiC,QAAQjC,EAAQ+B,GAK3B,OADAnC,EAAUsC,KAAKN,EAAOC,GACf7B,EAAOkC,KAAKN,EAAOC,GAI9B,OAAOjC,EAAUuC,cAErB"}
|
package/dist/view.min.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
!function(t){"use strict";function e(t,e){let i=1;const o="out"===e,s=Math.abs(t);if(s>1){for(;o?i<s:i<=s;)i*=2;o&&(i/=2)}else{for(;o?i>=s:i>s;)i/=2;o||(i*=2)}return i/t}t.Plugin.add("view"),t.Leafer.prototype.zoom=function(i,o,s){const{zoomLayer:h}=this,n=this.canvas.bounds.clone().shrink(void 0!==o?o:30),a=new t.Bounds,d={x:n.x+n.width/2,y:n.y+n.height/2};let r;const{scaleX:c}=this.__;if("string"==typeof i)switch(i){case"in":r=e(c,"in");break;case"out":r=e(c,"out");break;case"fit":i=this.boxBounds;break;case"fit-width":(i=new t.Bounds(this.boxBounds)).height=0;break;case"fit-height":(i=new t.Bounds(this.boxBounds)).width=0}else"number"==typeof i&&(r=i/c);if(r)1!==r&&h.scaleOfWorld(d,this.getValidScale(r));else if("object"==typeof i){const e=i instanceof Array;if(e||i.tag){const o=e?i:[i];a.setListWithFn(o,t.LeafBoundsHelper.worldBounds)}else{const t=function(t,e){let i,{x:o,y:s,width:h,height:n}=t;return n||(n=h*(e.height/e.width),i=!0),h||(h=n*(e.width/e.height),i=!0),i?{x:o,y:s,width:h,height:n}:t}(i,n);a.set(h.getWorldBounds(t))}const{x:o,y:d,width:r,height:c}=a;let f=n.x-o,l=n.y-d;if(s)f+=Math.max((n.width-r)/2,0),l+=Math.max((n.height-c)/2,0);else{const t=this.getValidScale(Math.min(n.width/r,n.height/c));f+=(n.width-r*t)/2,l+=(n.height-c*t)/2,h.scaleOfWorld(a,t),a.scaleOf(a,t)}return h.move(f,l),a.move(f,l)}return h.worldBoxBounds}}(LeaferUI);
|
|
2
|
+
//# sourceMappingURL=view.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.min.js","sources":["../../../../../../src/in/packages/view/src/helper.ts","../../../../../../src/in/packages/view/src/index.ts"],"sourcesContent":["import { IBoundsData } from '@leafer-ui/interface'\n\n\nexport function getZoomScale(scaleX: number, type: 'in' | 'out'): number {\n let scale = 1\n const out = type === 'out', absScale = Math.abs(scaleX)\n if (absScale > 1) {\n while (out ? scale < absScale : scale <= absScale) scale *= 2\n if (out) scale /= 2\n } else {\n while (out ? scale >= absScale : scale > absScale) scale /= 2\n if (!out) scale *= 2\n }\n return scale / scaleX\n}\n\nexport function getFixBounds(bounds: IBoundsData, scaleBounds: IBoundsData): IBoundsData {\n let { x, y, width, height } = bounds\n let fix: boolean\n if (!height) height = width * (scaleBounds.height / scaleBounds.width), fix = true\n if (!width) width = height * (scaleBounds.width / scaleBounds.height), fix = true\n return fix ? { x, y, width, height } : bounds\n}","import { ILeaf, IBoundsData, IZoomType, IFourNumber, IPointData } from '@leafer-ui/interface'\nimport { Leafer, Bounds, LeafBoundsHelper, Plugin } from '@leafer-ui/draw'\n\nimport { getFixBounds, getZoomScale } from './helper'\n\n\nPlugin.add('view')\n\n\nLeafer.prototype.zoom = function (zoomType: IZoomType, padding?: IFourNumber, fixed?: boolean): IBoundsData {\n\n const { zoomLayer } = this\n const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds()\n const center: IPointData = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 }\n\n let changeScale: number\n const { scaleX } = this.__\n\n if (typeof zoomType === 'string') {\n\n switch (zoomType) {\n case 'in':\n changeScale = getZoomScale(scaleX, 'in')\n break\n case 'out':\n changeScale = getZoomScale(scaleX, 'out')\n break\n case 'fit':\n zoomType = this.boxBounds\n break\n case 'fit-width':\n zoomType = new Bounds(this.boxBounds)\n zoomType.height = 0\n break\n case 'fit-height':\n zoomType = new Bounds(this.boxBounds)\n zoomType.width = 0\n break\n }\n\n } else if (typeof zoomType === 'number') {\n changeScale = zoomType / scaleX\n }\n\n\n if (changeScale) {\n\n if (changeScale !== 1) zoomLayer.scaleOfWorld(center, this.getValidScale(changeScale))\n\n } else if (typeof zoomType === 'object') {\n\n const isArray = zoomType instanceof Array\n\n if (isArray || (zoomType as ILeaf).tag) {\n const list: ILeaf[] = isArray ? zoomType as ILeaf[] : [zoomType as ILeaf]\n bounds.setListWithFn(list, LeafBoundsHelper.worldBounds)\n } else {\n const innerBounds = getFixBounds(zoomType as IBoundsData, limitBounds)\n bounds.set(zoomLayer.getWorldBounds(innerBounds))\n }\n\n const { x, y, width, height } = bounds\n let moveX = limitBounds.x - x, moveY = limitBounds.y - y\n\n if (fixed) {\n\n moveX += Math.max((limitBounds.width - width) / 2, 0)\n moveY += Math.max((limitBounds.height - height) / 2, 0)\n\n } else {\n\n const fitScale = this.getValidScale(Math.min(limitBounds.width / width, limitBounds.height / height))\n moveX += (limitBounds.width - width * fitScale) / 2\n moveY += (limitBounds.height - height * fitScale) / 2\n\n zoomLayer.scaleOfWorld(bounds, fitScale)\n bounds.scaleOf(bounds, fitScale)\n\n }\n\n zoomLayer.move(moveX, moveY)\n return bounds.move(moveX, moveY)\n\n }\n\n return zoomLayer.worldBoxBounds\n\n}"],"names":["getZoomScale","scaleX","type","scale","out","absScale","Math","abs","Plugin","add","draw","Leafer","prototype","zoom","zoomType","padding","fixed","zoomLayer","this","limitBounds","canvas","bounds","clone","shrink","undefined","Bounds","center","x","width","y","height","changeScale","__","boxBounds","scaleOfWorld","getValidScale","isArray","Array","tag","list","setListWithFn","LeafBoundsHelper","worldBounds","innerBounds","scaleBounds","fix","getFixBounds","set","getWorldBounds","moveX","moveY","max","fitScale","min","scaleOf","move","worldBoxBounds"],"mappings":"0BAGgB,SAAAA,EAAaC,EAAgBC,GACzC,IAAIC,EAAQ,EACZ,MAAMC,EAAe,QAATF,EAAgBG,EAAWC,KAAKC,IAAIN,GAChD,GAAII,EAAW,EAAG,CACd,KAAOD,EAAMD,EAAQE,EAAWF,GAASE,GAAUF,GAAS,EACxDC,IAAKD,GAAS,OACf,CACH,KAAOC,EAAMD,GAASE,EAAWF,EAAQE,GAAUF,GAAS,EACvDC,IAAKD,GAAS,GAEvB,OAAOA,EAAQF,CACnB,CCRAO,EAAAA,OAAOC,IAAI,QAGLC,EAAAC,OAACC,UAAUC,KAAO,SAAUC,EAAqBC,EAAuBC,GAE1E,MAAMC,UAAEA,GAAcC,KAChBC,EAAcD,KAAKE,OAAOC,OAAOC,QAAQC,YAAmBC,IAAZT,EAAwBA,EAAU,IAAKM,EAAS,IAAII,EAAAA,OACpGC,EAAqB,CAAEC,EAAGR,EAAYQ,EAAIR,EAAYS,MAAQ,EAAGC,EAAGV,EAAYU,EAAIV,EAAYW,OAAS,GAE/G,IAAIC,EACJ,MAAM9B,OAAEA,GAAWiB,KAAKc,GAExB,GAAwB,iBAAblB,EAEP,OAAQA,GACJ,IAAK,KACDiB,EAAc/B,EAAaC,EAAQ,MACnC,MACJ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,KAAK+C,IAAIlC,EAAYS,MAAQA,EAAOT,EAAYW,OAASA,IAC7FmB,IAAU9B,EAAYS,MAAQA,EAAQwB,GAAY,EAClDF,IAAU/B,EAAYW,OAASA,EAASsB,GAAY,EAEpDnC,EAAUiB,aAAab,EAAQ+B,GAC/B/B,EAAOiC,QAAQjC,EAAQ+B,GAK3B,OADAnC,EAAUsC,KAAKN,EAAOC,GACf7B,EAAOkC,KAAKN,EAAOC,GAI9B,OAAOjC,EAAUuC,cAErB"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-in/view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "@leafer-in/view",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/view.esm.js",
|
|
9
9
|
"exports": {
|
|
10
|
-
"import": "./dist/view.esm.js",
|
|
11
|
-
"require": "./dist/view.cjs",
|
|
10
|
+
"import": "./dist/view.esm.min.js",
|
|
11
|
+
"require": "./dist/view.min.cjs",
|
|
12
12
|
"types": "./types/index.d.ts"
|
|
13
13
|
},
|
|
14
14
|
"types": "types/index.d.ts",
|
|
15
|
-
"unpkg": "dist/view.js",
|
|
16
|
-
"jsdelivr": "dist/view.js",
|
|
15
|
+
"unpkg": "dist/view.min.js",
|
|
16
|
+
"jsdelivr": "dist/view.min.js",
|
|
17
17
|
"files": [
|
|
18
18
|
"src",
|
|
19
19
|
"types",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"leaferjs"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@leafer-ui/draw": "^1.
|
|
38
|
-
"@leafer-ui/interface": "^1.
|
|
39
|
-
"@leafer-in/interface": "^1.
|
|
37
|
+
"@leafer-ui/draw": "^1.4.0",
|
|
38
|
+
"@leafer-ui/interface": "^1.4.0",
|
|
39
|
+
"@leafer-in/interface": "^1.4.0"
|
|
40
40
|
}
|
|
41
41
|
}
|