Changeset 0c6b92a for imaps-frontend/node_modules/konva/lib/Layer.js
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/konva/lib/Layer.js
rd565449 r0c6b92a 10 10 const Shape_1 = require("./Shape"); 11 11 const Global_1 = require("./Global"); 12 varHASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [12 const HASH = '#', BEFORE_DRAW = 'beforeDraw', DRAW = 'draw', INTERSECTION_OFFSETS = [ 13 13 { x: 0, y: 0 }, 14 14 { x: -1, y: -1 }, … … 53 53 setZIndex(index) { 54 54 super.setZIndex(index); 55 varstage = this.getStage();55 const stage = this.getStage(); 56 56 if (stage && stage.content) { 57 57 stage.content.removeChild(this.getNativeCanvasElement()); … … 67 67 moveToTop() { 68 68 Node_1.Node.prototype.moveToTop.call(this); 69 varstage = this.getStage();69 const stage = this.getStage(); 70 70 if (stage && stage.content) { 71 71 stage.content.removeChild(this.getNativeCanvasElement()); … … 75 75 } 76 76 moveUp() { 77 varmoved = Node_1.Node.prototype.moveUp.call(this);77 const moved = Node_1.Node.prototype.moveUp.call(this); 78 78 if (!moved) { 79 79 return false; 80 80 } 81 varstage = this.getStage();81 const stage = this.getStage(); 82 82 if (!stage || !stage.content) { 83 83 return false; … … 94 94 moveDown() { 95 95 if (Node_1.Node.prototype.moveDown.call(this)) { 96 varstage = this.getStage();96 const stage = this.getStage(); 97 97 if (stage) { 98 varchildren = stage.children;98 const children = stage.children; 99 99 if (stage.content) { 100 100 stage.content.removeChild(this.getNativeCanvasElement()); … … 108 108 moveToBottom() { 109 109 if (Node_1.Node.prototype.moveToBottom.call(this)) { 110 varstage = this.getStage();110 const stage = this.getStage(); 111 111 if (stage) { 112 varchildren = stage.children;112 const children = stage.children; 113 113 if (stage.content) { 114 114 stage.content.removeChild(this.getNativeCanvasElement()); … … 124 124 } 125 125 remove() { 126 var_canvas = this.getNativeCanvasElement();126 const _canvas = this.getNativeCanvasElement(); 127 127 Node_1.Node.prototype.remove.call(this); 128 128 if (_canvas && _canvas.parentNode && Util_1.Util._isInDocument(_canvas)) { … … 141 141 } 142 142 _validateAdd(child) { 143 vartype = child.getType();143 const type = child.getType(); 144 144 if (type !== 'Group' && type !== 'Shape') { 145 145 Util_1.Util.throw('You may only add groups and shapes to a layer.'); … … 197 197 return null; 198 198 } 199 varspiralSearchDistance = 1;200 varcontinueSearch = false;199 let spiralSearchDistance = 1; 200 let continueSearch = false; 201 201 while (true) { 202 202 for (let i = 0; i < INTERSECTION_OFFSETS_LEN; i++) { … … 247 247 } 248 248 drawScene(can, top) { 249 varlayer = this.getLayer(), canvas = can || (layer && layer.getCanvas());249 const layer = this.getLayer(), canvas = can || (layer && layer.getCanvas()); 250 250 this._fire(BEFORE_DRAW, { 251 251 node: this, … … 261 261 } 262 262 drawHit(can, top) { 263 varlayer = this.getLayer(), canvas = can || (layer && layer.hitCanvas);263 const layer = this.getLayer(), canvas = can || (layer && layer.hitCanvas); 264 264 if (layer && layer.clearBeforeDraw()) { 265 265 layer.getHitCanvas().getContext().clear(); … … 288 288 return; 289 289 } 290 varparent = this.parent;291 varadded = !!this.hitCanvas._canvas.parentNode;290 const parent = this.parent; 291 const added = !!this.hitCanvas._canvas.parentNode; 292 292 if (added) { 293 293 parent.content.removeChild(this.hitCanvas._canvas);
Note:
See TracChangeset
for help on using the changeset viewer.