Changeset 0c6b92a for imaps-frontend/node_modules/konva/lib/Container.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/konva/lib/Container.js
rd565449 r0c6b92a 15 15 } 16 16 const children = this.children || []; 17 varresults = [];17 const results = []; 18 18 children.forEach(function (child) { 19 19 if (filterFunc(child)) { … … 51 51 } 52 52 if (children.length > 1) { 53 for ( vari = 0; i < children.length; i++) {53 for (let i = 0; i < children.length; i++) { 54 54 this.add(children[i]); 55 55 } … … 83 83 } 84 84 findOne(selector) { 85 varresult = this._generalFind(selector, true);85 const result = this._generalFind(selector, true); 86 86 return result.length > 0 ? result[0] : undefined; 87 87 } 88 88 _generalFind(selector, findOne) { 89 varretArr = [];89 const retArr = []; 90 90 this._descendants((node) => { 91 91 const valid = node._isMatch(selector); … … 119 119 } 120 120 toObject() { 121 varobj = Node_1.Node.prototype.toObject.call(this);121 const obj = Node_1.Node.prototype.toObject.call(this); 122 122 obj.children = []; 123 123 this.getChildren().forEach((child) => { … … 127 127 } 128 128 isAncestorOf(node) { 129 varparent = node.getParent();129 let parent = node.getParent(); 130 130 while (parent) { 131 131 if (parent._id === this._id) { … … 137 137 } 138 138 clone(obj) { 139 varnode = Node_1.Node.prototype.clone.call(this, obj);139 const node = Node_1.Node.prototype.clone.call(this, obj); 140 140 this.getChildren().forEach(function (no) { 141 141 node.add(no.clone()); … … 144 144 } 145 145 getAllIntersections(pos) { 146 vararr = [];146 const arr = []; 147 147 this.find('Shape').forEach((shape) => { 148 148 if (shape.isVisible() && shape.intersects(pos)) { … … 170 170 } 171 171 drawScene(can, top, bufferCanvas) { 172 varlayer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;173 varcaching = canvas && canvas.isCache;172 const layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene; 173 const caching = canvas && canvas.isCache; 174 174 if (!this.isVisible() && !caching) { 175 175 return this; … … 177 177 if (cachedSceneCanvas) { 178 178 context.save(); 179 varm = this.getAbsoluteTransform(top).getMatrix();179 const m = this.getAbsoluteTransform(top).getMatrix(); 180 180 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 181 181 this._drawCachedSceneCanvas(context); … … 191 191 return this; 192 192 } 193 varlayer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;193 const layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit; 194 194 if (cachedHitCanvas) { 195 195 context.save(); 196 varm = this.getAbsoluteTransform(top).getMatrix();196 const m = this.getAbsoluteTransform(top).getMatrix(); 197 197 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 198 198 this._drawCachedHitCanvas(context); … … 206 206 _drawChildren(drawMethod, canvas, top, bufferCanvas) { 207 207 var _a; 208 varcontext = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') ||208 const context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = (typeof clipWidth === 'number' && typeof clipHeight === 'number') || 209 209 clipFunc; 210 210 const selfCache = top === this; 211 211 if (hasClip) { 212 212 context.save(); 213 vartransform = this.getAbsoluteTransform(top);214 varm = transform.getMatrix();213 const transform = this.getAbsoluteTransform(top); 214 let m = transform.getMatrix(); 215 215 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 216 216 context.beginPath(); … … 220 220 } 221 221 else { 222 varclipX = this.clipX();223 varclipY = this.clipY();222 const clipX = this.clipX(); 223 const clipY = this.clipY(); 224 224 context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight); 225 225 } … … 228 228 context.transform(m[0], m[1], m[2], m[3], m[4], m[5]); 229 229 } 230 varhasComposition = !selfCache &&230 const hasComposition = !selfCache && 231 231 this.globalCompositeOperation() !== 'source-over' && 232 232 drawMethod === 'drawScene'; … … 247 247 getClientRect(config = {}) { 248 248 var _a; 249 varskipTransform = config.skipTransform;250 varrelativeTo = config.relativeTo;251 varminX, minY, maxX, maxY;252 varselfRect = {249 const skipTransform = config.skipTransform; 250 const relativeTo = config.relativeTo; 251 let minX, minY, maxX, maxY; 252 let selfRect = { 253 253 x: Infinity, 254 254 y: Infinity, … … 256 256 height: 0, 257 257 }; 258 varthat = this;258 const that = this; 259 259 (_a = this.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { 260 260 if (!child.visible()) { 261 261 return; 262 262 } 263 varrect = child.getClientRect({263 const rect = child.getClientRect({ 264 264 relativeTo: that, 265 265 skipShadow: config.skipShadow, … … 282 282 } 283 283 }); 284 varshapes = this.find('Shape');285 varhasVisible = false;286 for ( vari = 0; i < shapes.length; i++) {287 varshape = shapes[i];284 const shapes = this.find('Shape'); 285 let hasVisible = false; 286 for (let i = 0; i < shapes.length; i++) { 287 const shape = shapes[i]; 288 288 if (shape._isVisible(this)) { 289 289 hasVisible = true;
Note:
See TracChangeset
for help on using the changeset viewer.