Fix image layer resize jitter
Disable desynchronized 2D canvas mode for image layers so resize paint stays synchronized and avoids blank-frame jitter on some platforms. Signed-off-by: sergiochan <yuheng9211@qq.com>
This commit is contained in:
@@ -358,7 +358,8 @@ export class ImageRenderer extends Disposable implements IDisposable {
|
|||||||
canvas.style.zIndex = '0';
|
canvas.style.zIndex = '0';
|
||||||
screenElement.appendChild(canvas);
|
screenElement.appendChild(canvas);
|
||||||
}
|
}
|
||||||
const ctx = canvas.getContext('2d', { alpha: true, desynchronized: true });
|
// Keep rendering synchronized with resize to avoid blank-frame jitter on some platforms.
|
||||||
|
const ctx = canvas.getContext('2d', { alpha: true, desynchronized: false });
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
canvas.remove();
|
canvas.remove();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user