lythreeframe 1.0.28 → 1.0.30
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/bundle.cjs.js
CHANGED
|
@@ -1664,9 +1664,16 @@ class Viewport {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
this.isRenderStateDirty = false;
|
|
1666
1666
|
}
|
|
1667
|
-
renderAsImage() {
|
|
1668
|
-
|
|
1669
|
-
|
|
1667
|
+
renderAsImage(width = 1024, height = 1024) {
|
|
1668
|
+
this.render();
|
|
1669
|
+
const offscreenCanvas = document.createElement('canvas');
|
|
1670
|
+
offscreenCanvas.width = width;
|
|
1671
|
+
offscreenCanvas.height = height;
|
|
1672
|
+
const context = offscreenCanvas.getContext('2d');
|
|
1673
|
+
if (context) {
|
|
1674
|
+
context.drawImage(this.renderer.domElement, 0, 0, width, height);
|
|
1675
|
+
}
|
|
1676
|
+
return offscreenCanvas.toDataURL('image/jpeg');
|
|
1670
1677
|
}
|
|
1671
1678
|
destroy() {
|
|
1672
1679
|
var _a;
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1662,9 +1662,16 @@ class Viewport {
|
|
|
1662
1662
|
}
|
|
1663
1663
|
this.isRenderStateDirty = false;
|
|
1664
1664
|
}
|
|
1665
|
-
renderAsImage() {
|
|
1666
|
-
|
|
1667
|
-
|
|
1665
|
+
renderAsImage(width = 1024, height = 1024) {
|
|
1666
|
+
this.render();
|
|
1667
|
+
const offscreenCanvas = document.createElement('canvas');
|
|
1668
|
+
offscreenCanvas.width = width;
|
|
1669
|
+
offscreenCanvas.height = height;
|
|
1670
|
+
const context = offscreenCanvas.getContext('2d');
|
|
1671
|
+
if (context) {
|
|
1672
|
+
context.drawImage(this.renderer.domElement, 0, 0, width, height);
|
|
1673
|
+
}
|
|
1674
|
+
return offscreenCanvas.toDataURL('image/jpeg');
|
|
1668
1675
|
}
|
|
1669
1676
|
destroy() {
|
|
1670
1677
|
var _a;
|