From dd4d94d513bf60b5b5ddf3235c55564c6e2921db Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Mon, 23 Jun 2025 11:10:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=A9=E7=95=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client-modules/src/render/components/thumbnail.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages-user/client-modules/src/render/components/thumbnail.tsx b/packages-user/client-modules/src/render/components/thumbnail.tsx index 34e0ce8..d30bb81 100644 --- a/packages-user/client-modules/src/render/components/thumbnail.tsx +++ b/packages-user/client-modules/src/render/components/thumbnail.tsx @@ -15,6 +15,7 @@ export interface ThumbnailProps extends SpriteProps { // configs damage?: boolean; all?: boolean; + size?: number; } export const Thumbnail = defineComponent(props => { @@ -25,13 +26,14 @@ export const Thumbnail = defineComponent(props => { }; const drawThumbnail = (canvas: MotaOffscreenCanvas2D) => { + const ctx = canvas.ctx; const hero = props.hero; const options: Partial = { damage: props.damage, - ctx: canvas.ctx, + ctx: ctx, x: 0, y: 0, - size: 1, + size: props.size ?? 1, all: props.all, noHD: false, v2: true, @@ -44,7 +46,11 @@ export const Thumbnail = defineComponent(props => { options.centerX = hero.loc.x; options.centerY = hero.loc.y; } + ctx.save(); + ctx.fillStyle = props.padStyle; + ctx.fillRect(0, 0, canvas.width, canvas.height); core.drawThumbnail(props.floorId, props.map, options); + ctx.restore(); }; watch(props, update);