mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
make sure everything is loaded before generating thumb
This commit is contained in:
parent
42c2b1243f
commit
7d34f916ac
@ -1,9 +1,12 @@
|
|||||||
import 'blueimp-canvas-to-blob'; // canvas toBlob polyfill
|
import 'blueimp-canvas-to-blob'; // canvas toBlob polyfill
|
||||||
import createScene from '../d3/createScene.js';
|
import createScene from '../d3/createScene.js';
|
||||||
import { IMAGE_TYPE, IMAGE_QUALITY } from '../constants/saveConstants.js';
|
import { IMAGE_TYPE, IMAGE_QUALITY } from '../constants/saveConstants.js';
|
||||||
|
import { load } from '../utils/loaded.js';
|
||||||
|
|
||||||
export function generateThumb(state, width, height, responseType = 'blob') {
|
export function generateThumb(state, width, height, responseType = 'blob') {
|
||||||
return new Promise((resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
|
await load;
|
||||||
|
|
||||||
const { render, renderer, setSize } = createScene(state);
|
const { render, renderer, setSize } = createScene(state);
|
||||||
|
|
||||||
setSize(width, height, 1.0);
|
setSize(width, height, 1.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user