microboard-temp 0.11.5 → 0.11.6

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.
@@ -22363,22 +22363,8 @@ class RichText extends BaseItem {
22363
22363
  const container = this.getTransformedContainer();
22364
22364
  const containerWidth = container.getWidth();
22365
22365
  const containerHeight = container.getHeight();
22366
- const worldMatrix = this.worldMatrixGetter?.();
22367
- let effectiveWidth = containerWidth;
22368
- let effectiveHeight = containerHeight;
22369
- if (worldMatrix) {
22370
- const localScaleX = this.transformation.getScale().x || 1;
22371
- const localScaleY = this.transformation.getScale().y || 1;
22372
- effectiveWidth = containerWidth * (worldMatrix.scaleX / localScaleX);
22373
- effectiveHeight = containerHeight * (worldMatrix.scaleY / localScaleY);
22374
- }
22375
- const optimal = findOptimalMaxWidthForTextAutoSize(nodes, effectiveWidth, effectiveHeight, effectiveWidth);
22376
- const worldTextScale = Math.min(effectiveWidth / optimal.bestMaxWidth, effectiveHeight / optimal.bestMaxHeight);
22377
- if (worldMatrix) {
22378
- const localScaleX = this.transformation.getScale().x || 1;
22379
- return worldTextScale * localScaleX / worldMatrix.scaleX;
22380
- }
22381
- return worldTextScale;
22366
+ const optimal = findOptimalMaxWidthForTextAutoSize(nodes, containerWidth, containerHeight, containerWidth);
22367
+ return Math.min(containerWidth / optimal.bestMaxWidth, containerHeight / optimal.bestMaxHeight);
22382
22368
  }
22383
22369
  applyAutoSizeScale(textScale, blockNodes) {
22384
22370
  const nodes = blockNodes ? blockNodes : this.getBlockNodes();
package/dist/cjs/index.js CHANGED
@@ -22363,22 +22363,8 @@ class RichText extends BaseItem {
22363
22363
  const container = this.getTransformedContainer();
22364
22364
  const containerWidth = container.getWidth();
22365
22365
  const containerHeight = container.getHeight();
22366
- const worldMatrix = this.worldMatrixGetter?.();
22367
- let effectiveWidth = containerWidth;
22368
- let effectiveHeight = containerHeight;
22369
- if (worldMatrix) {
22370
- const localScaleX = this.transformation.getScale().x || 1;
22371
- const localScaleY = this.transformation.getScale().y || 1;
22372
- effectiveWidth = containerWidth * (worldMatrix.scaleX / localScaleX);
22373
- effectiveHeight = containerHeight * (worldMatrix.scaleY / localScaleY);
22374
- }
22375
- const optimal = findOptimalMaxWidthForTextAutoSize(nodes, effectiveWidth, effectiveHeight, effectiveWidth);
22376
- const worldTextScale = Math.min(effectiveWidth / optimal.bestMaxWidth, effectiveHeight / optimal.bestMaxHeight);
22377
- if (worldMatrix) {
22378
- const localScaleX = this.transformation.getScale().x || 1;
22379
- return worldTextScale * localScaleX / worldMatrix.scaleX;
22380
- }
22381
- return worldTextScale;
22366
+ const optimal = findOptimalMaxWidthForTextAutoSize(nodes, containerWidth, containerHeight, containerWidth);
22367
+ return Math.min(containerWidth / optimal.bestMaxWidth, containerHeight / optimal.bestMaxHeight);
22382
22368
  }
22383
22369
  applyAutoSizeScale(textScale, blockNodes) {
22384
22370
  const nodes = blockNodes ? blockNodes : this.getBlockNodes();
package/dist/cjs/node.js CHANGED
@@ -24835,22 +24835,8 @@ class RichText extends BaseItem {
24835
24835
  const container = this.getTransformedContainer();
24836
24836
  const containerWidth = container.getWidth();
24837
24837
  const containerHeight = container.getHeight();
24838
- const worldMatrix = this.worldMatrixGetter?.();
24839
- let effectiveWidth = containerWidth;
24840
- let effectiveHeight = containerHeight;
24841
- if (worldMatrix) {
24842
- const localScaleX = this.transformation.getScale().x || 1;
24843
- const localScaleY = this.transformation.getScale().y || 1;
24844
- effectiveWidth = containerWidth * (worldMatrix.scaleX / localScaleX);
24845
- effectiveHeight = containerHeight * (worldMatrix.scaleY / localScaleY);
24846
- }
24847
- const optimal = findOptimalMaxWidthForTextAutoSize(nodes, effectiveWidth, effectiveHeight, effectiveWidth);
24848
- const worldTextScale = Math.min(effectiveWidth / optimal.bestMaxWidth, effectiveHeight / optimal.bestMaxHeight);
24849
- if (worldMatrix) {
24850
- const localScaleX = this.transformation.getScale().x || 1;
24851
- return worldTextScale * localScaleX / worldMatrix.scaleX;
24852
- }
24853
- return worldTextScale;
24838
+ const optimal = findOptimalMaxWidthForTextAutoSize(nodes, containerWidth, containerHeight, containerWidth);
24839
+ return Math.min(containerWidth / optimal.bestMaxWidth, containerHeight / optimal.bestMaxHeight);
24854
24840
  }
24855
24841
  applyAutoSizeScale(textScale, blockNodes) {
24856
24842
  const nodes = blockNodes ? blockNodes : this.getBlockNodes();
@@ -22192,22 +22192,8 @@ class RichText extends BaseItem {
22192
22192
  const container = this.getTransformedContainer();
22193
22193
  const containerWidth = container.getWidth();
22194
22194
  const containerHeight = container.getHeight();
22195
- const worldMatrix = this.worldMatrixGetter?.();
22196
- let effectiveWidth = containerWidth;
22197
- let effectiveHeight = containerHeight;
22198
- if (worldMatrix) {
22199
- const localScaleX = this.transformation.getScale().x || 1;
22200
- const localScaleY = this.transformation.getScale().y || 1;
22201
- effectiveWidth = containerWidth * (worldMatrix.scaleX / localScaleX);
22202
- effectiveHeight = containerHeight * (worldMatrix.scaleY / localScaleY);
22203
- }
22204
- const optimal = findOptimalMaxWidthForTextAutoSize(nodes, effectiveWidth, effectiveHeight, effectiveWidth);
22205
- const worldTextScale = Math.min(effectiveWidth / optimal.bestMaxWidth, effectiveHeight / optimal.bestMaxHeight);
22206
- if (worldMatrix) {
22207
- const localScaleX = this.transformation.getScale().x || 1;
22208
- return worldTextScale * localScaleX / worldMatrix.scaleX;
22209
- }
22210
- return worldTextScale;
22195
+ const optimal = findOptimalMaxWidthForTextAutoSize(nodes, containerWidth, containerHeight, containerWidth);
22196
+ return Math.min(containerWidth / optimal.bestMaxWidth, containerHeight / optimal.bestMaxHeight);
22211
22197
  }
22212
22198
  applyAutoSizeScale(textScale, blockNodes) {
22213
22199
  const nodes = blockNodes ? blockNodes : this.getBlockNodes();
package/dist/esm/index.js CHANGED
@@ -22185,22 +22185,8 @@ class RichText extends BaseItem {
22185
22185
  const container = this.getTransformedContainer();
22186
22186
  const containerWidth = container.getWidth();
22187
22187
  const containerHeight = container.getHeight();
22188
- const worldMatrix = this.worldMatrixGetter?.();
22189
- let effectiveWidth = containerWidth;
22190
- let effectiveHeight = containerHeight;
22191
- if (worldMatrix) {
22192
- const localScaleX = this.transformation.getScale().x || 1;
22193
- const localScaleY = this.transformation.getScale().y || 1;
22194
- effectiveWidth = containerWidth * (worldMatrix.scaleX / localScaleX);
22195
- effectiveHeight = containerHeight * (worldMatrix.scaleY / localScaleY);
22196
- }
22197
- const optimal = findOptimalMaxWidthForTextAutoSize(nodes, effectiveWidth, effectiveHeight, effectiveWidth);
22198
- const worldTextScale = Math.min(effectiveWidth / optimal.bestMaxWidth, effectiveHeight / optimal.bestMaxHeight);
22199
- if (worldMatrix) {
22200
- const localScaleX = this.transformation.getScale().x || 1;
22201
- return worldTextScale * localScaleX / worldMatrix.scaleX;
22202
- }
22203
- return worldTextScale;
22188
+ const optimal = findOptimalMaxWidthForTextAutoSize(nodes, containerWidth, containerHeight, containerWidth);
22189
+ return Math.min(containerWidth / optimal.bestMaxWidth, containerHeight / optimal.bestMaxHeight);
22204
22190
  }
22205
22191
  applyAutoSizeScale(textScale, blockNodes) {
22206
22192
  const nodes = blockNodes ? blockNodes : this.getBlockNodes();
package/dist/esm/node.js CHANGED
@@ -24652,22 +24652,8 @@ class RichText extends BaseItem {
24652
24652
  const container = this.getTransformedContainer();
24653
24653
  const containerWidth = container.getWidth();
24654
24654
  const containerHeight = container.getHeight();
24655
- const worldMatrix = this.worldMatrixGetter?.();
24656
- let effectiveWidth = containerWidth;
24657
- let effectiveHeight = containerHeight;
24658
- if (worldMatrix) {
24659
- const localScaleX = this.transformation.getScale().x || 1;
24660
- const localScaleY = this.transformation.getScale().y || 1;
24661
- effectiveWidth = containerWidth * (worldMatrix.scaleX / localScaleX);
24662
- effectiveHeight = containerHeight * (worldMatrix.scaleY / localScaleY);
24663
- }
24664
- const optimal = findOptimalMaxWidthForTextAutoSize(nodes, effectiveWidth, effectiveHeight, effectiveWidth);
24665
- const worldTextScale = Math.min(effectiveWidth / optimal.bestMaxWidth, effectiveHeight / optimal.bestMaxHeight);
24666
- if (worldMatrix) {
24667
- const localScaleX = this.transformation.getScale().x || 1;
24668
- return worldTextScale * localScaleX / worldMatrix.scaleX;
24669
- }
24670
- return worldTextScale;
24655
+ const optimal = findOptimalMaxWidthForTextAutoSize(nodes, containerWidth, containerHeight, containerWidth);
24656
+ return Math.min(containerWidth / optimal.bestMaxWidth, containerHeight / optimal.bestMaxHeight);
24671
24657
  }
24672
24658
  applyAutoSizeScale(textScale, blockNodes) {
24673
24659
  const nodes = blockNodes ? blockNodes : this.getBlockNodes();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.11.5",
3
+ "version": "0.11.6",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",