Make image downscaling have a configurable factor (#1044)
Remove downscaling
This commit is contained in:
parent
29af355f20
commit
fb6ca73808
|
|
@ -79,14 +79,7 @@ export async function extractPixelData(imageData: ImageBitmapSource): Promise<Im
|
||||||
// Decode the image file binary data
|
// Decode the image file binary data
|
||||||
const image = await createImageBitmap(svgImageData || imageData);
|
const image = await createImageBitmap(svgImageData || imageData);
|
||||||
|
|
||||||
// Halve the image size until the editor lag is somewhat usable
|
|
||||||
// TODO: Fix lag so this can be removed
|
|
||||||
const MAX_IMAGE_SIZE = 512;
|
|
||||||
let { width, height } = image;
|
let { width, height } = image;
|
||||||
while (width > MAX_IMAGE_SIZE || height > MAX_IMAGE_SIZE) {
|
|
||||||
width /= 2;
|
|
||||||
height /= 2;
|
|
||||||
}
|
|
||||||
width = Math.floor(width);
|
width = Math.floor(width);
|
||||||
height = Math.floor(height);
|
height = Math.floor(height);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue