emacroh5lib 1.0.50 → 1.0.53
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
@@ -136,7 +136,7 @@
|
|
136
136
|
initListDataCache(index = 0) {
|
137
137
|
const promises = [];
|
138
138
|
|
139
|
-
const $this =
|
139
|
+
const $this = this
|
140
140
|
|
141
141
|
this.list.forEach((item, i) => {
|
142
142
|
const imageObject = new Image();
|
@@ -229,29 +229,29 @@
|
|
229
229
|
resetZoom(adaptive = true) {
|
230
230
|
const image = this.image;
|
231
231
|
|
232
|
-
//
|
233
|
-
//
|
234
|
-
//
|
235
|
-
//
|
236
|
-
//
|
237
|
-
//
|
238
|
-
//
|
232
|
+
// if (image != null && image.computed && image.width != null && image.height != null) {
|
233
|
+
// let { width, height } = image;
|
234
|
+
// if (adaptive) {
|
235
|
+
// let rate = 1
|
236
|
+
// if (width > height) {
|
237
|
+
// rate = width / document.body.clientWidth
|
238
|
+
// } else {
|
239
|
+
// rate = height / document.body.clientHeight
|
240
|
+
// }
|
241
|
+
// width = width / rate
|
242
|
+
// height = height / rate
|
239
243
|
// }
|
240
|
-
// width = width / rate
|
241
|
-
// height = height / rate
|
242
|
-
// }
|
243
|
-
|
244
|
-
// this.setStyleByName(image, "width", `${width}px`);
|
245
|
-
// this.setStyleByName(image, "height", `${height}px`);
|
246
244
|
|
247
|
-
//
|
248
|
-
// this.
|
249
|
-
// this.listDataCache[this.index].height = `${height}px`;
|
250
|
-
// }
|
245
|
+
// this.setStyleByName(image, "width", `${width}px`);
|
246
|
+
// this.setStyleByName(image, "height", `${height}px`);
|
251
247
|
|
248
|
+
// if (this.listDataCache[this.index] != null) {
|
249
|
+
// this.listDataCache[this.index].width = `${width}px`;
|
250
|
+
// this.listDataCache[this.index].height = `${height}px`;
|
251
|
+
// }
|
252
|
+
// }
|
252
253
|
|
253
254
|
|
254
|
-
// --------------------------------------------------------------------------------------------------
|
255
255
|
const imageObject = new Image();
|
256
256
|
imageObject.src = this.list[this.index];
|
257
257
|
const $this = this
|
@@ -272,11 +272,10 @@
|
|
272
272
|
$this.setStyleByName(image, "width", `${width}px`);
|
273
273
|
$this.setStyleByName(image, "height", `${height}px`);
|
274
274
|
|
275
|
-
|
276
|
-
|
275
|
+
this.listDataCache[this.index].width = `${width}px`;
|
276
|
+
this.listDataCache[this.index].height = `${height}px`;
|
277
277
|
}
|
278
278
|
|
279
|
-
|
280
279
|
},
|
281
280
|
|
282
281
|
// Reset all action
|
@@ -370,8 +369,8 @@
|
|
370
369
|
width: `${imageObject.width}px`,
|
371
370
|
height: `${imageObject.height}px`,
|
372
371
|
};
|
373
|
-
if (this.currentData != null && this.currentData.width != null && this.currentData.height != null &&
|
374
|
-
|
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) {
|
375
374
|
data = this.currentData
|
376
375
|
}
|
377
376
|
|