chore: 调整抗锯齿设置

This commit is contained in:
unanmed 2025-09-30 13:37:00 +08:00
parent 61e09f6395
commit 8f4f8d86a9

View File

@ -429,7 +429,6 @@ export abstract class RenderItem<E extends ERenderItemEvent = ERenderItemEvent>
const ctx = canvas.ctx; const ctx = canvas.ctx;
ctx.save(); ctx.save();
canvas.setAntiAliasing(this.antiAliasing);
if (this.type === 'static') transformCanvas(canvas, tran); if (this.type === 'static') transformCanvas(canvas, tran);
ctx.filter = this.filter; ctx.filter = this.filter;
ctx.globalAlpha = this.alpha; ctx.globalAlpha = this.alpha;
@ -442,9 +441,10 @@ export abstract class RenderItem<E extends ERenderItemEvent = ERenderItemEvent>
this.cacheDirty = false; this.cacheDirty = false;
} }
canvas.ctx.imageSmoothingEnabled = false; canvas.setAntiAliasing(false);
canvas.ctx.drawImage(this.cache.canvas, ax, ay, width, height); canvas.ctx.drawImage(this.cache.canvas, ax, ay, width, height);
} else { } else {
canvas.setAntiAliasing(this.antiAliasing);
canvas.ctx.translate(ax, ay); canvas.ctx.translate(ax, ay);
this.render(canvas, tran); this.render(canvas, tran);
this.cacheDirty = false; this.cacheDirty = false;