microboard-ui-temp 0.1.87 → 0.1.89

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.
package/dist/example.html CHANGED
@@ -84,7 +84,7 @@
84
84
  "
85
85
  >
86
86
  <div style="transform: scale(7)">
87
- <img src="public/loader.svg" alt="" />
87
+ <img href="https://unpkg.com/microboard-ui-temp/dist/loader.svg" alt="" />
88
88
  </div>
89
89
  </div>
90
90
  </div>
package/dist/index.js CHANGED
@@ -250194,10 +250194,22 @@ class ImageItem extends BaseItem {
250194
250194
  };
250195
250195
  updateMbr() {
250196
250196
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
250197
- this.left = translateX;
250198
- this.top = translateY;
250199
- this.right = this.left + this.image.width * scaleX;
250200
- this.bottom = this.top + this.image.height * scaleY;
250197
+ const rotation = this.transformation.getRotation();
250198
+ const width2 = this.image.width * scaleX;
250199
+ const height2 = this.image.height * scaleY;
250200
+ if (rotation % 180 === 0) {
250201
+ this.left = translateX;
250202
+ this.top = translateY;
250203
+ this.right = this.left + width2;
250204
+ this.bottom = this.top + height2;
250205
+ } else {
250206
+ const centerX = translateX + width2 / 2;
250207
+ const centerY = translateY + height2 / 2;
250208
+ this.left = centerX - height2 / 2;
250209
+ this.top = centerY - width2 / 2;
250210
+ this.right = this.left + height2;
250211
+ this.bottom = this.top + width2;
250212
+ }
250201
250213
  }
250202
250214
  doOnceBeforeOnLoad = (callback) => {
250203
250215
  this.loadCallbacks.push(callback);
package/dist/spa.js CHANGED
@@ -250194,10 +250194,22 @@ class ImageItem extends BaseItem {
250194
250194
  };
250195
250195
  updateMbr() {
250196
250196
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
250197
- this.left = translateX;
250198
- this.top = translateY;
250199
- this.right = this.left + this.image.width * scaleX;
250200
- this.bottom = this.top + this.image.height * scaleY;
250197
+ const rotation = this.transformation.getRotation();
250198
+ const width2 = this.image.width * scaleX;
250199
+ const height2 = this.image.height * scaleY;
250200
+ if (rotation % 180 === 0) {
250201
+ this.left = translateX;
250202
+ this.top = translateY;
250203
+ this.right = this.left + width2;
250204
+ this.bottom = this.top + height2;
250205
+ } else {
250206
+ const centerX = translateX + width2 / 2;
250207
+ const centerY = translateY + height2 / 2;
250208
+ this.left = centerX - height2 / 2;
250209
+ this.top = centerY - width2 / 2;
250210
+ this.right = this.left + height2;
250211
+ this.bottom = this.top + width2;
250212
+ }
250201
250213
  }
250202
250214
  doOnceBeforeOnLoad = (callback) => {
250203
250215
  this.loadCallbacks.push(callback);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.1.87",
3
+ "version": "0.1.89",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "i18next-browser-languagedetector": "^8.2.0",
61
61
  "js-cookie": "^3.0.5",
62
62
  "jwt-decode": "^4.0.0",
63
- "microboard-temp": "^0.5.28",
63
+ "microboard-temp": "^0.5.29",
64
64
  "nanoid": "^5.1.5",
65
65
  "prop-types": "^15.8.1",
66
66
  "react-hot-toast": "2.4.1",