emacroh5lib 1.0.53 → 1.0.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emacroh5lib",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "EMacro前端组件库",
5
5
  "main": "dist/emacroh5lib.min.js",
6
6
  "scripts": {
@@ -356,30 +356,18 @@
356
356
 
357
357
  setTimeout(() => {
358
358
 
359
- let data = {
360
- transform: {
361
- scaleX: "1",
362
- skewY: "0",
363
- translateX: "-50%",
364
- translateY: "-50%",
365
- rotate: "0deg",
366
- },
367
- left: "50%",
368
- top: "50%",
369
- width: `${imageObject.width}px`,
370
- height: `${imageObject.height}px`,
371
- };
372
- if (this.currentData != null && this.currentData.width != null && this.currentData.height != null &&
373
- this.currentData.left != null && this.currentData.top != null && this.currentData.transform != null) {
374
- data = this.currentData
359
+ try {
360
+ const data = this.currentData
361
+
362
+ this.setStyleByName(this.image, "width", data.width);
363
+ this.setStyleByName(this.image, "height", data.height);
364
+ this.setStyleByName(this.image, "left", data.left);
365
+ this.setStyleByName(this.image, "top", data.top);
366
+ this.setTransform(this.image, data.transform);
367
+ } catch (error) {
368
+ console.log("switchAction", error, this.currentData);
375
369
  }
376
370
 
377
- this.setStyleByName(this.image, "width", data.width);
378
- this.setStyleByName(this.image, "height", data.height);
379
- this.setStyleByName(this.image, "left", data.left);
380
- this.setStyleByName(this.image, "top", data.top);
381
- this.setTransform(this.image, data.transform);
382
-
383
371
  this.resetZoom();
384
372
  this.resetPosition();
385
373
  }, 100);