@leafer/miniapp 1.12.3 → 1.12.4
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/miniapp.module.js
CHANGED
|
@@ -246,11 +246,13 @@ const Platform = {
|
|
|
246
246
|
const ctx = canvas.getContext("2d");
|
|
247
247
|
if (opacity) ctx.globalAlpha = opacity;
|
|
248
248
|
ctx.imageSmoothingEnabled = smooth === false ? false : true;
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
if (image) {
|
|
250
|
+
if (clip) {
|
|
251
|
+
const scaleX = width / clip.width, scaleY = height / clip.height;
|
|
252
|
+
ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY);
|
|
253
|
+
ctx.drawImage(image, 0, 0, image.width, image.height);
|
|
254
|
+
} else ctx.drawImage(image, 0, 0, width, height);
|
|
255
|
+
}
|
|
254
256
|
return canvas;
|
|
255
257
|
},
|
|
256
258
|
setPatternTransform(pattern, transform, paint) {
|
|
@@ -4220,13 +4222,13 @@ class LeaferImage {
|
|
|
4220
4222
|
return this.url;
|
|
4221
4223
|
}
|
|
4222
4224
|
setThumbView(_view) {}
|
|
4223
|
-
getThumbSize() {
|
|
4225
|
+
getThumbSize(_lod) {
|
|
4224
4226
|
return undefined;
|
|
4225
4227
|
}
|
|
4226
4228
|
getMinLevel() {
|
|
4227
4229
|
return undefined;
|
|
4228
4230
|
}
|
|
4229
|
-
getLevelData(_level) {
|
|
4231
|
+
getLevelData(_level, _width, _height) {
|
|
4230
4232
|
return undefined;
|
|
4231
4233
|
}
|
|
4232
4234
|
clearLevels(_checkUse) {}
|
|
@@ -6958,7 +6960,7 @@ class LeafLevelList {
|
|
|
6958
6960
|
}
|
|
6959
6961
|
}
|
|
6960
6962
|
|
|
6961
|
-
const version = "1.12.
|
|
6963
|
+
const version = "1.12.4";
|
|
6962
6964
|
|
|
6963
6965
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6964
6966
|
get allowBackgroundColor() {
|
|
@@ -11919,7 +11921,7 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
|
11919
11921
|
ignoreRender(ui, false);
|
|
11920
11922
|
onLoadError(ui, event, error);
|
|
11921
11923
|
leafPaint.loadId = undefined;
|
|
11922
|
-
}, paint.lod && image.getThumbSize());
|
|
11924
|
+
}, paint.lod && image.getThumbSize(paint.lod));
|
|
11923
11925
|
if (ui.placeholderColor) {
|
|
11924
11926
|
if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
|
|
11925
11927
|
if (!image.ready) {
|