fix width calculation
This commit is contained in:
parent
d2e2656c26
commit
edfc921d48
|
@ -140,14 +140,18 @@ export function renderOverlay(
|
||||||
context.scale(offscreenScale, offscreenScale);
|
context.scale(offscreenScale, offscreenScale);
|
||||||
context.globalAlpha = state.templates.oOpacity / 100;
|
context.globalAlpha = state.templates.oOpacity / 100;
|
||||||
for (const template of templates) {
|
for (const template of templates) {
|
||||||
const tempWidth = template.x - x + width / 2 / offscreenScale;
|
if (template.width * offscreenScale < 1
|
||||||
const tempHeight = template.y - y + height / 2 / offscreenScale;
|
|| template.height * offscreenScale < 1
|
||||||
if (tempWidth < 1 || tempHeight < 1) continue;
|
) continue;
|
||||||
|
|
||||||
const image = templateLoader.getTemplateSync(template.imageId);
|
const image = templateLoader.getTemplateSync(template.imageId);
|
||||||
if (!image) continue;
|
if (!image) continue;
|
||||||
|
|
||||||
context.drawImage(image, tempWidth, tempHeight);
|
context.drawImage(
|
||||||
|
image,
|
||||||
|
template.x - x + width / 2 / offscreenScale,
|
||||||
|
template.y - y + height / 2 / offscreenScale,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
context.restore();
|
context.restore();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user