fix: 不指定透明度时启用透明度通道

This commit is contained in:
unanmed 2025-05-25 18:07:06 +08:00
parent 7b4f907bc2
commit a3115fff60

View File

@ -35,7 +35,7 @@ export interface MotaRendererConfig {
width: number; width: number;
/** 画布的高度,所有渲染操作会自行适配缩放 */ /** 画布的高度,所有渲染操作会自行适配缩放 */
height: number; height: number;
/** 是否启用不透明度通道 */ /** 是否启用不透明度通道,默认启用 */
alpha?: boolean; alpha?: boolean;
} }
@ -77,7 +77,7 @@ export class MotaRenderer extends Container implements IRenderTreeRoot {
logger.error(19); logger.error(19);
return; return;
} }
this.target = new MotaOffscreenCanvas2D(config.alpha, canvas); this.target = new MotaOffscreenCanvas2D(config.alpha ?? true, canvas);
this.size(config.width, config.height); this.size(config.width, config.height);
this.target.withGameScale(true); this.target.withGameScale(true);
this.target.setAntiAliasing(false); this.target.setAntiAliasing(false);