konva 9.3.14 → 9.3.16

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.
Files changed (68) hide show
  1. package/konva.js +754 -737
  2. package/konva.min.js +3 -3
  3. package/lib/Animation.js +1 -1
  4. package/lib/BezierFunctions.js +1 -2
  5. package/lib/Canvas.js +9 -9
  6. package/lib/Container.d.ts +1 -1
  7. package/lib/Container.js +29 -29
  8. package/lib/Context.d.ts +2 -2
  9. package/lib/Context.js +26 -26
  10. package/lib/DragAndDrop.d.ts +2 -2
  11. package/lib/DragAndDrop.js +6 -4
  12. package/lib/Factory.js +16 -16
  13. package/lib/Global.js +1 -1
  14. package/lib/Group.js +1 -1
  15. package/lib/Layer.js +17 -17
  16. package/lib/Node.d.ts +4 -4
  17. package/lib/Node.js +87 -87
  18. package/lib/PointerEvents.js +5 -6
  19. package/lib/Shape.js +31 -31
  20. package/lib/Stage.d.ts +3 -3
  21. package/lib/Stage.js +28 -28
  22. package/lib/Tween.js +21 -21
  23. package/lib/Util.d.ts +4 -4
  24. package/lib/Util.js +62 -62
  25. package/lib/Validators.js +16 -17
  26. package/lib/_CoreInternals.d.ts +8 -8
  27. package/lib/_FullInternals.d.ts +8 -8
  28. package/lib/filters/Blur.js +6 -6
  29. package/lib/filters/Brighten.js +1 -1
  30. package/lib/filters/Contrast.js +2 -2
  31. package/lib/filters/Emboss.js +19 -19
  32. package/lib/filters/Enhance.js +4 -4
  33. package/lib/filters/Grayscale.js +1 -1
  34. package/lib/filters/HSL.js +6 -6
  35. package/lib/filters/HSV.js +7 -7
  36. package/lib/filters/Invert.js +1 -1
  37. package/lib/filters/Kaleidoscope.js +20 -20
  38. package/lib/filters/Mask.js +57 -57
  39. package/lib/filters/Noise.js +2 -2
  40. package/lib/filters/Pixelate.js +1 -1
  41. package/lib/filters/Posterize.js +1 -1
  42. package/lib/filters/RGB.js +1 -1
  43. package/lib/filters/RGBA.js +3 -3
  44. package/lib/filters/Sepia.js +1 -1
  45. package/lib/filters/Solarize.js +8 -7
  46. package/lib/filters/Threshold.js +2 -2
  47. package/lib/shapes/Arc.js +1 -1
  48. package/lib/shapes/Arrow.js +10 -10
  49. package/lib/shapes/Ellipse.js +1 -1
  50. package/lib/shapes/Image.js +3 -3
  51. package/lib/shapes/Label.d.ts +1 -1
  52. package/lib/shapes/Label.js +6 -6
  53. package/lib/shapes/Line.d.ts +1 -1
  54. package/lib/shapes/Line.js +14 -14
  55. package/lib/shapes/Path.d.ts +8 -8
  56. package/lib/shapes/Path.js +68 -68
  57. package/lib/shapes/Rect.js +1 -1
  58. package/lib/shapes/RegularPolygon.js +6 -6
  59. package/lib/shapes/Ring.js +1 -1
  60. package/lib/shapes/Sprite.js +9 -9
  61. package/lib/shapes/Star.js +5 -5
  62. package/lib/shapes/Text.d.ts +13 -13
  63. package/lib/shapes/Text.js +52 -38
  64. package/lib/shapes/TextPath.d.ts +2 -2
  65. package/lib/shapes/TextPath.js +23 -23
  66. package/lib/shapes/Transformer.d.ts +1 -1
  67. package/lib/shapes/Transformer.js +63 -63
  68. package/package.json +2 -5
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Text = exports.stringToArray = void 0;
3
+ exports.Text = void 0;
4
+ exports.stringToArray = stringToArray;
4
5
  const Util_1 = require("../Util");
5
6
  const Factory_1 = require("../Factory");
6
7
  const Shape_1 = require("../Shape");
@@ -8,10 +9,23 @@ const Global_1 = require("../Global");
8
9
  const Validators_1 = require("../Validators");
9
10
  const Global_2 = require("../Global");
10
11
  function stringToArray(string) {
11
- return Array.from(string);
12
+ return [...string].reduce((acc, char, index, array) => {
13
+ if (/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?(?:\u200D\p{Emoji_Presentation})+/u.test(char)) {
14
+ acc.push(char);
15
+ }
16
+ else if (/\p{Regional_Indicator}{2}/u.test(char + (array[index + 1] || ''))) {
17
+ acc.push(char + array[index + 1]);
18
+ }
19
+ else if (index > 0 && /\p{Mn}|\p{Me}|\p{Mc}/u.test(char)) {
20
+ acc[acc.length - 1] += char;
21
+ }
22
+ else {
23
+ acc.push(char);
24
+ }
25
+ return acc;
26
+ }, []);
12
27
  }
13
- exports.stringToArray = stringToArray;
14
- var AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', LTR = 'ltr', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [
28
+ const AUTO = 'auto', CENTER = 'center', INHERIT = 'inherit', JUSTIFY = 'justify', CHANGE_KONVA = 'Change.konva', CONTEXT_2D = '2d', DASH = '-', LEFT = 'left', TEXT = 'text', TEXT_UPPER = 'Text', TOP = 'top', BOTTOM = 'bottom', MIDDLE = 'middle', NORMAL = 'normal', PX_SPACE = 'px ', SPACE = ' ', RIGHT = 'right', RTL = 'rtl', WORD = 'word', CHAR = 'char', NONE = 'none', ELLIPSIS = '…', ATTR_CHANGE_LIST = [
15
29
  'direction',
16
30
  'fontFamily',
17
31
  'fontSize',
@@ -42,7 +56,7 @@ function normalizeFontFamily(fontFamily) {
42
56
  })
43
57
  .join(', ');
44
58
  }
45
- var dummyContext;
59
+ let dummyContext;
46
60
  function getDummyContext() {
47
61
  if (dummyContext) {
48
62
  return dummyContext;
@@ -71,22 +85,22 @@ class Text extends Shape_1.Shape {
71
85
  super(checkDefaultFill(config));
72
86
  this._partialTextX = 0;
73
87
  this._partialTextY = 0;
74
- for (var n = 0; n < attrChangeListLen; n++) {
88
+ for (let n = 0; n < attrChangeListLen; n++) {
75
89
  this.on(ATTR_CHANGE_LIST[n] + CHANGE_KONVA, this._setTextData);
76
90
  }
77
91
  this._setTextData();
78
92
  }
79
93
  _sceneFunc(context) {
80
- var textArr = this.textArr, textArrLen = textArr.length;
94
+ const textArr = this.textArr, textArrLen = textArr.length;
81
95
  if (!this.text()) {
82
96
  return;
83
97
  }
84
- var padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n;
98
+ let padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf('underline') !== -1, shouldLineThrough = textDecoration.indexOf('line-through') !== -1, n;
85
99
  direction = direction === INHERIT ? context.direction : direction;
86
- var translateY = lineHeightPx / 2;
87
- var baseline = MIDDLE;
100
+ let translateY = lineHeightPx / 2;
101
+ let baseline = MIDDLE;
88
102
  if (Global_1.Konva._fixTextRendering) {
89
- var metrics = this.measureSize('M');
103
+ const metrics = this.measureSize('M');
90
104
  baseline = 'alphabetic';
91
105
  translateY =
92
106
  (metrics.fontBoundingBoxAscent - metrics.fontBoundingBoxDescent) / 2 +
@@ -121,7 +135,7 @@ class Text extends Shape_1.Shape {
121
135
  if (shouldUnderline) {
122
136
  context.save();
123
137
  context.beginPath();
124
- let yOffset = Global_1.Konva._fixTextRendering
138
+ const yOffset = Global_1.Konva._fixTextRendering
125
139
  ? Math.round(fontSize / 4)
126
140
  : Math.round(fontSize / 2);
127
141
  const x = lineTranslateX;
@@ -141,7 +155,7 @@ class Text extends Shape_1.Shape {
141
155
  if (shouldLineThrough) {
142
156
  context.save();
143
157
  context.beginPath();
144
- let yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
158
+ const yOffset = Global_1.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
145
159
  context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);
146
160
  spacesNumber = text.split(' ').length - 1;
147
161
  oneWord = spacesNumber === 0;
@@ -158,9 +172,9 @@ class Text extends Shape_1.Shape {
158
172
  }
159
173
  if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {
160
174
  spacesNumber = text.split(' ').length - 1;
161
- var array = stringToArray(text);
162
- for (var li = 0; li < array.length; li++) {
163
- var letter = array[li];
175
+ const array = stringToArray(text);
176
+ for (let li = 0; li < array.length; li++) {
177
+ const letter = array[li];
164
178
  if (letter === ' ' && !lastLine && align === JUSTIFY) {
165
179
  lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber;
166
180
  }
@@ -187,14 +201,14 @@ class Text extends Shape_1.Shape {
187
201
  }
188
202
  }
189
203
  _hitFunc(context) {
190
- var width = this.getWidth(), height = this.getHeight();
204
+ const width = this.getWidth(), height = this.getHeight();
191
205
  context.beginPath();
192
206
  context.rect(0, 0, width, height);
193
207
  context.closePath();
194
208
  context.fillStrokeShape(this);
195
209
  }
196
210
  setText(text) {
197
- var str = Util_1.Util._isString(text)
211
+ const str = Util_1.Util._isString(text)
198
212
  ? text
199
213
  : text === null || text === undefined
200
214
  ? ''
@@ -203,11 +217,11 @@ class Text extends Shape_1.Shape {
203
217
  return this;
204
218
  }
205
219
  getWidth() {
206
- var isAuto = this.attrs.width === AUTO || this.attrs.width === undefined;
220
+ const isAuto = this.attrs.width === AUTO || this.attrs.width === undefined;
207
221
  return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;
208
222
  }
209
223
  getHeight() {
210
- var isAuto = this.attrs.height === AUTO || this.attrs.height === undefined;
224
+ const isAuto = this.attrs.height === AUTO || this.attrs.height === undefined;
211
225
  return isAuto
212
226
  ? this.fontSize() * this.textArr.length * this.lineHeight() +
213
227
  this.padding() * 2
@@ -222,7 +236,7 @@ class Text extends Shape_1.Shape {
222
236
  }
223
237
  measureSize(text) {
224
238
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
225
- var _context = getDummyContext(), fontSize = this.fontSize(), metrics;
239
+ let _context = getDummyContext(), fontSize = this.fontSize(), metrics;
226
240
  _context.save();
227
241
  _context.font = this._getContextFont();
228
242
  metrics = _context.measureText(text);
@@ -257,7 +271,7 @@ class Text extends Shape_1.Shape {
257
271
  if (align === JUSTIFY) {
258
272
  line = line.trim();
259
273
  }
260
- var width = this._getTextWidth(line);
274
+ const width = this._getTextWidth(line);
261
275
  return this.textArr.push({
262
276
  text: line,
263
277
  width: width,
@@ -265,24 +279,24 @@ class Text extends Shape_1.Shape {
265
279
  });
266
280
  }
267
281
  _getTextWidth(text) {
268
- var letterSpacing = this.letterSpacing();
269
- var length = text.length;
282
+ const letterSpacing = this.letterSpacing();
283
+ const length = text.length;
270
284
  return (getDummyContext().measureText(text).width +
271
285
  (length ? letterSpacing * (length - 1) : 0));
272
286
  }
273
287
  _setTextData() {
274
- var lines = this.text().split('\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();
288
+ let lines = this.text().split('\n'), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== undefined, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();
275
289
  this.textArr = [];
276
290
  getDummyContext().font = this._getContextFont();
277
- var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;
278
- for (var i = 0, max = lines.length; i < max; ++i) {
279
- var line = lines[i];
280
- var lineWidth = this._getTextWidth(line);
291
+ const additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;
292
+ for (let i = 0, max = lines.length; i < max; ++i) {
293
+ let line = lines[i];
294
+ let lineWidth = this._getTextWidth(line);
281
295
  if (fixedWidth && lineWidth > maxWidth) {
282
296
  while (line.length > 0) {
283
- var low = 0, high = line.length, match = '', matchWidth = 0;
297
+ let low = 0, high = line.length, match = '', matchWidth = 0;
284
298
  while (low < high) {
285
- var mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;
299
+ const mid = (low + high) >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;
286
300
  if (substrWidth <= maxWidth) {
287
301
  low = mid + 1;
288
302
  match = substr;
@@ -295,8 +309,8 @@ class Text extends Shape_1.Shape {
295
309
  if (match) {
296
310
  if (wrapAtWord) {
297
311
  var wrapIndex;
298
- var nextChar = line[match.length];
299
- var nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;
312
+ const nextChar = line[match.length];
313
+ const nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;
300
314
  if (nextIsSpaceOrDash && matchWidth <= maxWidth) {
301
315
  wrapIndex = match.length;
302
316
  }
@@ -315,7 +329,7 @@ class Text extends Shape_1.Shape {
315
329
  this._addTextLine(match);
316
330
  textWidth = Math.max(textWidth, matchWidth);
317
331
  currentHeightPx += lineHeightPx;
318
- var shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);
332
+ const shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);
319
333
  if (shouldHandleEllipsis) {
320
334
  this._tryToAddEllipsisToLastLine();
321
335
  break;
@@ -356,18 +370,18 @@ class Text extends Shape_1.Shape {
356
370
  this.textWidth = textWidth;
357
371
  }
358
372
  _shouldHandleEllipsis(currentHeightPx) {
359
- var fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;
373
+ const fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== undefined, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;
360
374
  return (!shouldWrap ||
361
375
  (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx));
362
376
  }
363
377
  _tryToAddEllipsisToLastLine() {
364
- var width = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();
365
- var lastLine = this.textArr[this.textArr.length - 1];
378
+ const width = this.attrs.width, fixedWidth = width !== AUTO && width !== undefined, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();
379
+ const lastLine = this.textArr[this.textArr.length - 1];
366
380
  if (!lastLine || !shouldAddEllipsis) {
367
381
  return;
368
382
  }
369
383
  if (fixedWidth) {
370
- var haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;
384
+ const haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;
371
385
  if (!haveSpace) {
372
386
  lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3);
373
387
  }
@@ -28,8 +28,8 @@ export declare class TextPath extends Shape<TextPathConfig> {
28
28
  constructor(config?: TextPathConfig);
29
29
  _getTextPathLength(): number;
30
30
  _getPointAtLength(length: number): {
31
- x: any;
32
- y: any;
31
+ x: number;
32
+ y: number;
33
33
  } | null;
34
34
  _readDataAttribute(): void;
35
35
  _sceneFunc(context: Context): void;
@@ -8,7 +8,7 @@ const Path_1 = require("./Path");
8
8
  const Text_1 = require("./Text");
9
9
  const Validators_1 = require("../Validators");
10
10
  const Global_1 = require("../Global");
11
- var EMPTY_STRING = '', NORMAL = 'normal';
11
+ const EMPTY_STRING = '', NORMAL = 'normal';
12
12
  function _fillFunc(context) {
13
13
  context.fillText(this.partialText, 0, 0);
14
14
  }
@@ -50,16 +50,16 @@ class TextPath extends Shape_1.Shape {
50
50
  context.setAttr('textBaseline', this.textBaseline());
51
51
  context.setAttr('textAlign', 'left');
52
52
  context.save();
53
- var textDecoration = this.textDecoration();
54
- var fill = this.fill();
55
- var fontSize = this.fontSize();
56
- var glyphInfo = 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 (var i = 0; i < glyphInfo.length; i++) {
60
+ for (let i = 0; i < glyphInfo.length; i++) {
61
61
  context.save();
62
- var p0 = glyphInfo[i].p0;
62
+ const p0 = glyphInfo[i].p0;
63
63
  context.translate(p0.x, p0.y);
64
64
  context.rotate(glyphInfo[i].rotation);
65
65
  this.partialText = glyphInfo[i].text;
@@ -81,13 +81,13 @@ class TextPath extends Shape_1.Shape {
81
81
  }
82
82
  _hitFunc(context) {
83
83
  context.beginPath();
84
- var glyphInfo = this.glyphInfo;
84
+ const glyphInfo = this.glyphInfo;
85
85
  if (glyphInfo.length >= 1) {
86
- var p0 = glyphInfo[0].p0;
86
+ const p0 = glyphInfo[0].p0;
87
87
  context.moveTo(p0.x, p0.y);
88
88
  }
89
- for (var i = 0; i < glyphInfo.length; i++) {
90
- var p1 = 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
  }
93
93
  context.setAttr('lineWidth', this.fontSize());
@@ -108,11 +108,11 @@ class TextPath extends Shape_1.Shape {
108
108
  return Text_1.Text.prototype._getContextFont.call(this);
109
109
  }
110
110
  _getTextSize(text) {
111
- var dummyCanvas = 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
- var metrics = _context.measureText(text);
115
+ const metrics = _context.measureText(text);
116
116
  _context.restore();
117
117
  return {
118
118
  width: metrics.width,
@@ -140,7 +140,7 @@ class TextPath extends Shape_1.Shape {
140
140
  }
141
141
  const charArr = (0, Text_1.stringToArray)(this.text());
142
142
  let offsetToGlyph = offset;
143
- for (var i = 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)
146
146
  return;
@@ -187,19 +187,19 @@ class TextPath extends Shape_1.Shape {
187
187
  height: 0,
188
188
  };
189
189
  }
190
- var points = [];
190
+ const points = [];
191
191
  this.glyphInfo.forEach(function (info) {
192
192
  points.push(info.p0.x);
193
193
  points.push(info.p0.y);
194
194
  points.push(info.p1.x);
195
195
  points.push(info.p1.y);
196
196
  });
197
- var minX = points[0] || 0;
198
- var maxX = points[0] || 0;
199
- var minY = points[1] || 0;
200
- var maxY = points[1] || 0;
201
- var x, y;
202
- for (var i = 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];
205
205
  minX = Math.min(minX, x);
@@ -207,7 +207,7 @@ class TextPath extends Shape_1.Shape {
207
207
  minY = Math.min(minY, y);
208
208
  maxY = Math.max(maxY, y);
209
209
  }
210
- var fontSize = this.fontSize();
210
+ const fontSize = this.fontSize();
211
211
  return {
212
212
  x: minX - fontSize / 2,
213
213
  y: minY - fontSize / 2,
@@ -94,7 +94,7 @@ export declare class Transformer extends Group {
94
94
  toObject(): {
95
95
  attrs: any;
96
96
  className: string;
97
- children?: any[] | undefined;
97
+ children?: Array<any>;
98
98
  };
99
99
  clone(obj?: any): this;
100
100
  getClientRect(): IRect;