From ec263a875cda475760eb9b2a9babe11196bede6c Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Tue, 24 Nov 2026 21:06:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ThumbnailCell=20=E6=B2=A1=E6=98=BE?= =?UTF-8?q?=E5=BC=8F=E5=8A=A0=20zIndex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages-user/client-base/src/components/thumbnail.tsx | 5 +++++ packages/common/src/logger.json | 1 + 2 files changed, 6 insertions(+) diff --git a/packages-user/client-base/src/components/thumbnail.tsx b/packages-user/client-base/src/components/thumbnail.tsx index 27dedd6..69d130e 100644 --- a/packages-user/client-base/src/components/thumbnail.tsx +++ b/packages-user/client-base/src/components/thumbnail.tsx @@ -352,6 +352,7 @@ export const Thumbnail = defineComponent(props => { } }); + /** ThumbnailCell 的分块信息 */ const chunks = computed(() => { const renderer = props.renderer; if (!renderer || !props.area) { @@ -364,6 +365,8 @@ export const Thumbnail = defineComponent(props => { const [x, y] = props.area; const [nx, ny, nw, nh] = area.value; const { chunkWidth, chunkHeight } = renderer.vertex.block; + + // 获取目标渲染区域都有哪些分块,然后把这些分块形成 ThumbnailCell 能看懂的参数形式 const startChunkX = Math.floor(nx / chunkWidth + 1e-8); const startChunkY = Math.floor(ny / chunkHeight + 1e-8); const endChunkX = Math.ceil((nx + nw) / chunkWidth - 1e-8); @@ -389,6 +392,7 @@ export const Thumbnail = defineComponent(props => { } } + // 最后计算裁剪矩形的范围,裁剪矩形使用 destination-in 实现 const sx = Math.max(0, (nx - x) * renderer.cellWidth * size.value); const sy = Math.max(0, (ny - y) * renderer.cellHeight * size.value); const sw = nw * renderer.cellWidth * size.value; @@ -414,6 +418,7 @@ export const Thumbnail = defineComponent(props => { floorId={props.floorId} size={size.value} damage={props.damage} + zIndex={10} /> ))}