microboard-temp 0.11.6 → 0.11.8

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.
@@ -22412,8 +22412,14 @@ class RichText extends BaseItem {
22412
22412
  left = container.left;
22413
22413
  top = container.top;
22414
22414
  }
22415
+ const point3 = new Point(left, top);
22416
+ if (this.worldMatrixGetter) {
22417
+ this.worldMatrixGetter().apply(point3);
22418
+ } else {
22419
+ this.getParentWorldMatrix().apply(point3);
22420
+ }
22415
22421
  return {
22416
- point: new Point(left, top),
22422
+ point: point3,
22417
22423
  width,
22418
22424
  height,
22419
22425
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40477,22 +40483,29 @@ class Sticker extends BaseItem {
40477
40483
  this.linkTo = new LinkTo(this.id, this.board.events);
40478
40484
  this.transformation = new Transformation(this.id, this.board.events);
40479
40485
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40480
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40486
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40481
40487
  this.transformation.subject.subscribe((_subject, op) => {
40482
40488
  this.transformPath();
40483
40489
  if (op.method === "applyMatrix") {
40484
40490
  const itemOp = op.items.find((i) => i.id === this.id);
40485
- if (itemOp && (itemOp.matrix.scaleX !== 1 || itemOp.matrix.scaleY !== 1)) {
40486
- if (this.text.isAutosize()) {
40487
- if (itemOp.matrix.scaleX !== itemOp.matrix.scaleY) {
40488
- this.text.applyAutoSizeScale(this.text.calcAutoSize());
40491
+ if (itemOp) {
40492
+ const prevScaleX = this.transformation.previous.scaleX;
40493
+ const prevScaleY = this.transformation.previous.scaleY;
40494
+ const currentScaleX = this.transformation.getScale().x;
40495
+ const currentScaleY = this.transformation.getScale().y;
40496
+ const scaleChanged = Math.abs(currentScaleX - prevScaleX) > 0.0001 || Math.abs(currentScaleY - prevScaleY) > 0.0001;
40497
+ if (scaleChanged) {
40498
+ if (this.text.isAutosize()) {
40499
+ if (Math.abs(currentScaleX - currentScaleY) > 0.0001) {
40500
+ this.text.applyAutoSizeScale(this.text.calcAutoSize());
40501
+ } else {
40502
+ this.text.scaleAutoSizeScale(currentScaleX / prevScaleX);
40503
+ }
40504
+ this.text.recoordinate();
40505
+ this.text.transformCanvas();
40489
40506
  } else {
40490
- this.text.scaleAutoSizeScale(itemOp.matrix.scaleX);
40507
+ this.text.handleInshapeScale();
40491
40508
  }
40492
- this.text.recoordinate();
40493
- this.text.transformCanvas();
40494
- } else {
40495
- this.text.handleInshapeScale();
40496
40509
  }
40497
40510
  }
40498
40511
  }
@@ -53406,18 +53419,19 @@ class BoardSelection {
53406
53419
  }
53407
53420
  }
53408
53421
  setTextToEdit(item) {
53409
- if (this.textToEdit) {
53422
+ const text5 = item?.getRichText();
53423
+ if (this.textToEdit && this.textToEdit !== text5) {
53410
53424
  this.textToEdit.updateElement();
53411
53425
  this.textToEdit.enableRender();
53412
53426
  }
53413
- if (!(item && item.getRichText())) {
53427
+ if (!text5) {
53414
53428
  this.textToEdit = undefined;
53415
53429
  return;
53416
53430
  }
53417
- const text5 = item.getRichText();
53418
- if (!text5) {
53431
+ if (this.textToEdit === text5) {
53419
53432
  return;
53420
53433
  }
53434
+ this.textToEdit = text5;
53421
53435
  if (text5.isEmpty()) {
53422
53436
  const textColor = tempStorage.getFontColor(item.itemType);
53423
53437
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53451,7 +53465,6 @@ class BoardSelection {
53451
53465
  this.setVerticalAlignment(verticalAlignment);
53452
53466
  }
53453
53467
  }
53454
- this.textToEdit = text5;
53455
53468
  text5.editor.selectWholeText();
53456
53469
  this.textToEdit.disableRender();
53457
53470
  this.board.items.subject.publish(this.board.items);
package/dist/cjs/index.js CHANGED
@@ -22412,8 +22412,14 @@ class RichText extends BaseItem {
22412
22412
  left = container.left;
22413
22413
  top = container.top;
22414
22414
  }
22415
+ const point3 = new Point(left, top);
22416
+ if (this.worldMatrixGetter) {
22417
+ this.worldMatrixGetter().apply(point3);
22418
+ } else {
22419
+ this.getParentWorldMatrix().apply(point3);
22420
+ }
22415
22421
  return {
22416
- point: new Point(left, top),
22422
+ point: point3,
22417
22423
  width,
22418
22424
  height,
22419
22425
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40477,22 +40483,29 @@ class Sticker extends BaseItem {
40477
40483
  this.linkTo = new LinkTo(this.id, this.board.events);
40478
40484
  this.transformation = new Transformation(this.id, this.board.events);
40479
40485
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40480
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40486
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40481
40487
  this.transformation.subject.subscribe((_subject, op) => {
40482
40488
  this.transformPath();
40483
40489
  if (op.method === "applyMatrix") {
40484
40490
  const itemOp = op.items.find((i) => i.id === this.id);
40485
- if (itemOp && (itemOp.matrix.scaleX !== 1 || itemOp.matrix.scaleY !== 1)) {
40486
- if (this.text.isAutosize()) {
40487
- if (itemOp.matrix.scaleX !== itemOp.matrix.scaleY) {
40488
- this.text.applyAutoSizeScale(this.text.calcAutoSize());
40491
+ if (itemOp) {
40492
+ const prevScaleX = this.transformation.previous.scaleX;
40493
+ const prevScaleY = this.transformation.previous.scaleY;
40494
+ const currentScaleX = this.transformation.getScale().x;
40495
+ const currentScaleY = this.transformation.getScale().y;
40496
+ const scaleChanged = Math.abs(currentScaleX - prevScaleX) > 0.0001 || Math.abs(currentScaleY - prevScaleY) > 0.0001;
40497
+ if (scaleChanged) {
40498
+ if (this.text.isAutosize()) {
40499
+ if (Math.abs(currentScaleX - currentScaleY) > 0.0001) {
40500
+ this.text.applyAutoSizeScale(this.text.calcAutoSize());
40501
+ } else {
40502
+ this.text.scaleAutoSizeScale(currentScaleX / prevScaleX);
40503
+ }
40504
+ this.text.recoordinate();
40505
+ this.text.transformCanvas();
40489
40506
  } else {
40490
- this.text.scaleAutoSizeScale(itemOp.matrix.scaleX);
40507
+ this.text.handleInshapeScale();
40491
40508
  }
40492
- this.text.recoordinate();
40493
- this.text.transformCanvas();
40494
- } else {
40495
- this.text.handleInshapeScale();
40496
40509
  }
40497
40510
  }
40498
40511
  }
@@ -53406,18 +53419,19 @@ class BoardSelection {
53406
53419
  }
53407
53420
  }
53408
53421
  setTextToEdit(item) {
53409
- if (this.textToEdit) {
53422
+ const text5 = item?.getRichText();
53423
+ if (this.textToEdit && this.textToEdit !== text5) {
53410
53424
  this.textToEdit.updateElement();
53411
53425
  this.textToEdit.enableRender();
53412
53426
  }
53413
- if (!(item && item.getRichText())) {
53427
+ if (!text5) {
53414
53428
  this.textToEdit = undefined;
53415
53429
  return;
53416
53430
  }
53417
- const text5 = item.getRichText();
53418
- if (!text5) {
53431
+ if (this.textToEdit === text5) {
53419
53432
  return;
53420
53433
  }
53434
+ this.textToEdit = text5;
53421
53435
  if (text5.isEmpty()) {
53422
53436
  const textColor = tempStorage.getFontColor(item.itemType);
53423
53437
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53451,7 +53465,6 @@ class BoardSelection {
53451
53465
  this.setVerticalAlignment(verticalAlignment);
53452
53466
  }
53453
53467
  }
53454
- this.textToEdit = text5;
53455
53468
  text5.editor.selectWholeText();
53456
53469
  this.textToEdit.disableRender();
53457
53470
  this.board.items.subject.publish(this.board.items);
package/dist/cjs/node.js CHANGED
@@ -24884,8 +24884,14 @@ class RichText extends BaseItem {
24884
24884
  left = container.left;
24885
24885
  top = container.top;
24886
24886
  }
24887
+ const point3 = new Point(left, top);
24888
+ if (this.worldMatrixGetter) {
24889
+ this.worldMatrixGetter().apply(point3);
24890
+ } else {
24891
+ this.getParentWorldMatrix().apply(point3);
24892
+ }
24887
24893
  return {
24888
- point: new Point(left, top),
24894
+ point: point3,
24889
24895
  width,
24890
24896
  height,
24891
24897
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -42950,22 +42956,29 @@ class Sticker extends BaseItem {
42950
42956
  this.linkTo = new LinkTo(this.id, this.board.events);
42951
42957
  this.transformation = new Transformation(this.id, this.board.events);
42952
42958
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
42953
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
42959
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
42954
42960
  this.transformation.subject.subscribe((_subject, op) => {
42955
42961
  this.transformPath();
42956
42962
  if (op.method === "applyMatrix") {
42957
42963
  const itemOp = op.items.find((i) => i.id === this.id);
42958
- if (itemOp && (itemOp.matrix.scaleX !== 1 || itemOp.matrix.scaleY !== 1)) {
42959
- if (this.text.isAutosize()) {
42960
- if (itemOp.matrix.scaleX !== itemOp.matrix.scaleY) {
42961
- this.text.applyAutoSizeScale(this.text.calcAutoSize());
42964
+ if (itemOp) {
42965
+ const prevScaleX = this.transformation.previous.scaleX;
42966
+ const prevScaleY = this.transformation.previous.scaleY;
42967
+ const currentScaleX = this.transformation.getScale().x;
42968
+ const currentScaleY = this.transformation.getScale().y;
42969
+ const scaleChanged = Math.abs(currentScaleX - prevScaleX) > 0.0001 || Math.abs(currentScaleY - prevScaleY) > 0.0001;
42970
+ if (scaleChanged) {
42971
+ if (this.text.isAutosize()) {
42972
+ if (Math.abs(currentScaleX - currentScaleY) > 0.0001) {
42973
+ this.text.applyAutoSizeScale(this.text.calcAutoSize());
42974
+ } else {
42975
+ this.text.scaleAutoSizeScale(currentScaleX / prevScaleX);
42976
+ }
42977
+ this.text.recoordinate();
42978
+ this.text.transformCanvas();
42962
42979
  } else {
42963
- this.text.scaleAutoSizeScale(itemOp.matrix.scaleX);
42980
+ this.text.handleInshapeScale();
42964
42981
  }
42965
- this.text.recoordinate();
42966
- this.text.transformCanvas();
42967
- } else {
42968
- this.text.handleInshapeScale();
42969
42982
  }
42970
42983
  }
42971
42984
  }
@@ -55879,18 +55892,19 @@ class BoardSelection {
55879
55892
  }
55880
55893
  }
55881
55894
  setTextToEdit(item) {
55882
- if (this.textToEdit) {
55895
+ const text5 = item?.getRichText();
55896
+ if (this.textToEdit && this.textToEdit !== text5) {
55883
55897
  this.textToEdit.updateElement();
55884
55898
  this.textToEdit.enableRender();
55885
55899
  }
55886
- if (!(item && item.getRichText())) {
55900
+ if (!text5) {
55887
55901
  this.textToEdit = undefined;
55888
55902
  return;
55889
55903
  }
55890
- const text5 = item.getRichText();
55891
- if (!text5) {
55904
+ if (this.textToEdit === text5) {
55892
55905
  return;
55893
55906
  }
55907
+ this.textToEdit = text5;
55894
55908
  if (text5.isEmpty()) {
55895
55909
  const textColor = tempStorage.getFontColor(item.itemType);
55896
55910
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -55924,7 +55938,6 @@ class BoardSelection {
55924
55938
  this.setVerticalAlignment(verticalAlignment);
55925
55939
  }
55926
55940
  }
55927
- this.textToEdit = text5;
55928
55941
  text5.editor.selectWholeText();
55929
55942
  this.textToEdit.disableRender();
55930
55943
  this.board.items.subject.publish(this.board.items);
@@ -22241,8 +22241,14 @@ class RichText extends BaseItem {
22241
22241
  left = container.left;
22242
22242
  top = container.top;
22243
22243
  }
22244
+ const point3 = new Point(left, top);
22245
+ if (this.worldMatrixGetter) {
22246
+ this.worldMatrixGetter().apply(point3);
22247
+ } else {
22248
+ this.getParentWorldMatrix().apply(point3);
22249
+ }
22244
22250
  return {
22245
- point: new Point(left, top),
22251
+ point: point3,
22246
22252
  width,
22247
22253
  height,
22248
22254
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40306,22 +40312,29 @@ class Sticker extends BaseItem {
40306
40312
  this.linkTo = new LinkTo(this.id, this.board.events);
40307
40313
  this.transformation = new Transformation(this.id, this.board.events);
40308
40314
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40309
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40315
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40310
40316
  this.transformation.subject.subscribe((_subject, op) => {
40311
40317
  this.transformPath();
40312
40318
  if (op.method === "applyMatrix") {
40313
40319
  const itemOp = op.items.find((i) => i.id === this.id);
40314
- if (itemOp && (itemOp.matrix.scaleX !== 1 || itemOp.matrix.scaleY !== 1)) {
40315
- if (this.text.isAutosize()) {
40316
- if (itemOp.matrix.scaleX !== itemOp.matrix.scaleY) {
40317
- this.text.applyAutoSizeScale(this.text.calcAutoSize());
40320
+ if (itemOp) {
40321
+ const prevScaleX = this.transformation.previous.scaleX;
40322
+ const prevScaleY = this.transformation.previous.scaleY;
40323
+ const currentScaleX = this.transformation.getScale().x;
40324
+ const currentScaleY = this.transformation.getScale().y;
40325
+ const scaleChanged = Math.abs(currentScaleX - prevScaleX) > 0.0001 || Math.abs(currentScaleY - prevScaleY) > 0.0001;
40326
+ if (scaleChanged) {
40327
+ if (this.text.isAutosize()) {
40328
+ if (Math.abs(currentScaleX - currentScaleY) > 0.0001) {
40329
+ this.text.applyAutoSizeScale(this.text.calcAutoSize());
40330
+ } else {
40331
+ this.text.scaleAutoSizeScale(currentScaleX / prevScaleX);
40332
+ }
40333
+ this.text.recoordinate();
40334
+ this.text.transformCanvas();
40318
40335
  } else {
40319
- this.text.scaleAutoSizeScale(itemOp.matrix.scaleX);
40336
+ this.text.handleInshapeScale();
40320
40337
  }
40321
- this.text.recoordinate();
40322
- this.text.transformCanvas();
40323
- } else {
40324
- this.text.handleInshapeScale();
40325
40338
  }
40326
40339
  }
40327
40340
  }
@@ -53235,18 +53248,19 @@ class BoardSelection {
53235
53248
  }
53236
53249
  }
53237
53250
  setTextToEdit(item) {
53238
- if (this.textToEdit) {
53251
+ const text5 = item?.getRichText();
53252
+ if (this.textToEdit && this.textToEdit !== text5) {
53239
53253
  this.textToEdit.updateElement();
53240
53254
  this.textToEdit.enableRender();
53241
53255
  }
53242
- if (!(item && item.getRichText())) {
53256
+ if (!text5) {
53243
53257
  this.textToEdit = undefined;
53244
53258
  return;
53245
53259
  }
53246
- const text5 = item.getRichText();
53247
- if (!text5) {
53260
+ if (this.textToEdit === text5) {
53248
53261
  return;
53249
53262
  }
53263
+ this.textToEdit = text5;
53250
53264
  if (text5.isEmpty()) {
53251
53265
  const textColor = tempStorage.getFontColor(item.itemType);
53252
53266
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53280,7 +53294,6 @@ class BoardSelection {
53280
53294
  this.setVerticalAlignment(verticalAlignment);
53281
53295
  }
53282
53296
  }
53283
- this.textToEdit = text5;
53284
53297
  text5.editor.selectWholeText();
53285
53298
  this.textToEdit.disableRender();
53286
53299
  this.board.items.subject.publish(this.board.items);
package/dist/esm/index.js CHANGED
@@ -22234,8 +22234,14 @@ class RichText extends BaseItem {
22234
22234
  left = container.left;
22235
22235
  top = container.top;
22236
22236
  }
22237
+ const point3 = new Point(left, top);
22238
+ if (this.worldMatrixGetter) {
22239
+ this.worldMatrixGetter().apply(point3);
22240
+ } else {
22241
+ this.getParentWorldMatrix().apply(point3);
22242
+ }
22237
22243
  return {
22238
- point: new Point(left, top),
22244
+ point: point3,
22239
22245
  width,
22240
22246
  height,
22241
22247
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -40299,22 +40305,29 @@ class Sticker extends BaseItem {
40299
40305
  this.linkTo = new LinkTo(this.id, this.board.events);
40300
40306
  this.transformation = new Transformation(this.id, this.board.events);
40301
40307
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
40302
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
40308
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
40303
40309
  this.transformation.subject.subscribe((_subject, op) => {
40304
40310
  this.transformPath();
40305
40311
  if (op.method === "applyMatrix") {
40306
40312
  const itemOp = op.items.find((i) => i.id === this.id);
40307
- if (itemOp && (itemOp.matrix.scaleX !== 1 || itemOp.matrix.scaleY !== 1)) {
40308
- if (this.text.isAutosize()) {
40309
- if (itemOp.matrix.scaleX !== itemOp.matrix.scaleY) {
40310
- this.text.applyAutoSizeScale(this.text.calcAutoSize());
40313
+ if (itemOp) {
40314
+ const prevScaleX = this.transformation.previous.scaleX;
40315
+ const prevScaleY = this.transformation.previous.scaleY;
40316
+ const currentScaleX = this.transformation.getScale().x;
40317
+ const currentScaleY = this.transformation.getScale().y;
40318
+ const scaleChanged = Math.abs(currentScaleX - prevScaleX) > 0.0001 || Math.abs(currentScaleY - prevScaleY) > 0.0001;
40319
+ if (scaleChanged) {
40320
+ if (this.text.isAutosize()) {
40321
+ if (Math.abs(currentScaleX - currentScaleY) > 0.0001) {
40322
+ this.text.applyAutoSizeScale(this.text.calcAutoSize());
40323
+ } else {
40324
+ this.text.scaleAutoSizeScale(currentScaleX / prevScaleX);
40325
+ }
40326
+ this.text.recoordinate();
40327
+ this.text.transformCanvas();
40311
40328
  } else {
40312
- this.text.scaleAutoSizeScale(itemOp.matrix.scaleX);
40329
+ this.text.handleInshapeScale();
40313
40330
  }
40314
- this.text.recoordinate();
40315
- this.text.transformCanvas();
40316
- } else {
40317
- this.text.handleInshapeScale();
40318
40331
  }
40319
40332
  }
40320
40333
  }
@@ -53228,18 +53241,19 @@ class BoardSelection {
53228
53241
  }
53229
53242
  }
53230
53243
  setTextToEdit(item) {
53231
- if (this.textToEdit) {
53244
+ const text5 = item?.getRichText();
53245
+ if (this.textToEdit && this.textToEdit !== text5) {
53232
53246
  this.textToEdit.updateElement();
53233
53247
  this.textToEdit.enableRender();
53234
53248
  }
53235
- if (!(item && item.getRichText())) {
53249
+ if (!text5) {
53236
53250
  this.textToEdit = undefined;
53237
53251
  return;
53238
53252
  }
53239
- const text5 = item.getRichText();
53240
- if (!text5) {
53253
+ if (this.textToEdit === text5) {
53241
53254
  return;
53242
53255
  }
53256
+ this.textToEdit = text5;
53243
53257
  if (text5.isEmpty()) {
53244
53258
  const textColor = tempStorage.getFontColor(item.itemType);
53245
53259
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -53273,7 +53287,6 @@ class BoardSelection {
53273
53287
  this.setVerticalAlignment(verticalAlignment);
53274
53288
  }
53275
53289
  }
53276
- this.textToEdit = text5;
53277
53290
  text5.editor.selectWholeText();
53278
53291
  this.textToEdit.disableRender();
53279
53292
  this.board.items.subject.publish(this.board.items);
package/dist/esm/node.js CHANGED
@@ -24701,8 +24701,14 @@ class RichText extends BaseItem {
24701
24701
  left = container.left;
24702
24702
  top = container.top;
24703
24703
  }
24704
+ const point3 = new Point(left, top);
24705
+ if (this.worldMatrixGetter) {
24706
+ this.worldMatrixGetter().apply(point3);
24707
+ } else {
24708
+ this.getParentWorldMatrix().apply(point3);
24709
+ }
24704
24710
  return {
24705
- point: new Point(left, top),
24711
+ point: point3,
24706
24712
  width,
24707
24713
  height,
24708
24714
  maxWidth: maxWidth ? maxWidth + 1 : undefined,
@@ -42767,22 +42773,29 @@ class Sticker extends BaseItem {
42767
42773
  this.linkTo = new LinkTo(this.id, this.board.events);
42768
42774
  this.transformation = new Transformation(this.id, this.board.events);
42769
42775
  this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, " ", false, true, this.itemType);
42770
- this.text.worldMatrixGetter = () => this.getWorldMatrix();
42776
+ this.text.worldMatrixGetter = () => this.getParentWorldMatrix();
42771
42777
  this.transformation.subject.subscribe((_subject, op) => {
42772
42778
  this.transformPath();
42773
42779
  if (op.method === "applyMatrix") {
42774
42780
  const itemOp = op.items.find((i) => i.id === this.id);
42775
- if (itemOp && (itemOp.matrix.scaleX !== 1 || itemOp.matrix.scaleY !== 1)) {
42776
- if (this.text.isAutosize()) {
42777
- if (itemOp.matrix.scaleX !== itemOp.matrix.scaleY) {
42778
- this.text.applyAutoSizeScale(this.text.calcAutoSize());
42781
+ if (itemOp) {
42782
+ const prevScaleX = this.transformation.previous.scaleX;
42783
+ const prevScaleY = this.transformation.previous.scaleY;
42784
+ const currentScaleX = this.transformation.getScale().x;
42785
+ const currentScaleY = this.transformation.getScale().y;
42786
+ const scaleChanged = Math.abs(currentScaleX - prevScaleX) > 0.0001 || Math.abs(currentScaleY - prevScaleY) > 0.0001;
42787
+ if (scaleChanged) {
42788
+ if (this.text.isAutosize()) {
42789
+ if (Math.abs(currentScaleX - currentScaleY) > 0.0001) {
42790
+ this.text.applyAutoSizeScale(this.text.calcAutoSize());
42791
+ } else {
42792
+ this.text.scaleAutoSizeScale(currentScaleX / prevScaleX);
42793
+ }
42794
+ this.text.recoordinate();
42795
+ this.text.transformCanvas();
42779
42796
  } else {
42780
- this.text.scaleAutoSizeScale(itemOp.matrix.scaleX);
42797
+ this.text.handleInshapeScale();
42781
42798
  }
42782
- this.text.recoordinate();
42783
- this.text.transformCanvas();
42784
- } else {
42785
- this.text.handleInshapeScale();
42786
42799
  }
42787
42800
  }
42788
42801
  }
@@ -55696,18 +55709,19 @@ class BoardSelection {
55696
55709
  }
55697
55710
  }
55698
55711
  setTextToEdit(item) {
55699
- if (this.textToEdit) {
55712
+ const text5 = item?.getRichText();
55713
+ if (this.textToEdit && this.textToEdit !== text5) {
55700
55714
  this.textToEdit.updateElement();
55701
55715
  this.textToEdit.enableRender();
55702
55716
  }
55703
- if (!(item && item.getRichText())) {
55717
+ if (!text5) {
55704
55718
  this.textToEdit = undefined;
55705
55719
  return;
55706
55720
  }
55707
- const text5 = item.getRichText();
55708
- if (!text5) {
55721
+ if (this.textToEdit === text5) {
55709
55722
  return;
55710
55723
  }
55724
+ this.textToEdit = text5;
55711
55725
  if (text5.isEmpty()) {
55712
55726
  const textColor = tempStorage.getFontColor(item.itemType);
55713
55727
  const textSize = tempStorage.getFontSize(item.itemType);
@@ -55741,7 +55755,6 @@ class BoardSelection {
55741
55755
  this.setVerticalAlignment(verticalAlignment);
55742
55756
  }
55743
55757
  }
55744
- this.textToEdit = text5;
55745
55758
  text5.editor.selectWholeText();
55746
55759
  this.textToEdit.disableRender();
55747
55760
  this.board.items.subject.publish(this.board.items);
@@ -73,7 +73,6 @@ export declare class RichText extends BaseItem {
73
73
  getTextWidth(): number;
74
74
  getMaxWidth(): number | undefined;
75
75
  getMaxHeight(): number | undefined;
76
- /** Get text dimensions for text editor */
77
76
  getDimensions(): {
78
77
  point: Point;
79
78
  width: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.11.6",
3
+ "version": "0.11.8",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",