fix(tag): fix label tag

This commit is contained in:
zhangheng
2026-04-07 13:52:27 +08:00
parent 92fc5c47e5
commit 5db5e18049
2 changed files with 33 additions and 3 deletions

View File

@@ -5328,6 +5328,15 @@ export const usePaperStore = create<PaperState>((set) => ({
}) as paper.Item[]
tagItems.forEach((item) => {
if (item.data?.tag_category === "mask") return
const anchor = item.data?.tag_anchor
if (Array.isArray(anchor) && anchor.length >= 2) {
const anchorX = Number(anchor[0])
const anchorY = Number(anchor[1])
if (Number.isFinite(anchorX) && Number.isFinite(anchorY)) {
item.scale(1 / newScale, new paper.Point(anchorX, anchorY))
return
}
}
item.scale(1 / newScale)
})
}