Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/konva/lib/shapes/TextPath.js
rd565449 r0c6b92a 9 9 const Validators_1 = require("../Validators"); 10 10 const Global_1 = require("../Global"); 11 varEMPTY_STRING = '', NORMAL = 'normal';11 const EMPTY_STRING = '', NORMAL = 'normal'; 12 12 function _fillFunc(context) { 13 13 context.fillText(this.partialText, 0, 0); … … 51 51 context.setAttr('textAlign', 'left'); 52 52 context.save(); 53 vartextDecoration = this.textDecoration();54 varfill = this.fill();55 varfontSize = this.fontSize();56 varglyphInfo = this.glyphInfo;53 const textDecoration = this.textDecoration(); 54 const fill = this.fill(); 55 const fontSize = this.fontSize(); 56 const glyphInfo = this.glyphInfo; 57 57 if (textDecoration === 'underline') { 58 58 context.beginPath(); 59 59 } 60 for ( vari = 0; i < glyphInfo.length; i++) {60 for (let i = 0; i < glyphInfo.length; i++) { 61 61 context.save(); 62 varp0 = glyphInfo[i].p0;62 const p0 = glyphInfo[i].p0; 63 63 context.translate(p0.x, p0.y); 64 64 context.rotate(glyphInfo[i].rotation); … … 82 82 _hitFunc(context) { 83 83 context.beginPath(); 84 varglyphInfo = this.glyphInfo;84 const glyphInfo = this.glyphInfo; 85 85 if (glyphInfo.length >= 1) { 86 varp0 = glyphInfo[0].p0;86 const p0 = glyphInfo[0].p0; 87 87 context.moveTo(p0.x, p0.y); 88 88 } 89 for ( vari = 0; i < glyphInfo.length; i++) {90 varp1 = glyphInfo[i].p1;89 for (let i = 0; i < glyphInfo.length; i++) { 90 const p1 = glyphInfo[i].p1; 91 91 context.lineTo(p1.x, p1.y); 92 92 } … … 109 109 } 110 110 _getTextSize(text) { 111 vardummyCanvas = this.dummyCanvas;112 var_context = dummyCanvas.getContext('2d');111 const dummyCanvas = this.dummyCanvas; 112 const _context = dummyCanvas.getContext('2d'); 113 113 _context.save(); 114 114 _context.font = this._getContextFont(); 115 varmetrics = _context.measureText(text);115 const metrics = _context.measureText(text); 116 116 _context.restore(); 117 117 return { … … 141 141 const charArr = (0, Text_1.stringToArray)(this.text()); 142 142 let offsetToGlyph = offset; 143 for ( vari = 0; i < charArr.length; i++) {143 for (let i = 0; i < charArr.length; i++) { 144 144 const charStartPoint = this._getPointAtLength(offsetToGlyph); 145 145 if (!charStartPoint) … … 188 188 }; 189 189 } 190 varpoints = [];190 const points = []; 191 191 this.glyphInfo.forEach(function (info) { 192 192 points.push(info.p0.x); … … 195 195 points.push(info.p1.y); 196 196 }); 197 varminX = points[0] || 0;198 varmaxX = points[0] || 0;199 varminY = points[1] || 0;200 varmaxY = points[1] || 0;201 varx, y;202 for ( vari = 0; i < points.length / 2; i++) {197 let minX = points[0] || 0; 198 let maxX = points[0] || 0; 199 let minY = points[1] || 0; 200 let maxY = points[1] || 0; 201 let x, y; 202 for (let i = 0; i < points.length / 2; i++) { 203 203 x = points[i * 2]; 204 204 y = points[i * 2 + 1]; … … 208 208 maxY = Math.max(maxY, y); 209 209 } 210 varfontSize = this.fontSize();210 const fontSize = this.fontSize(); 211 211 return { 212 212 x: minX - fontSize / 2,
Note:
See TracChangeset
for help on using the changeset viewer.