fix(copy): fix

This commit is contained in:
zhangheng
2026-03-31 10:39:56 +08:00
parent 9e9ad0a590
commit d757aab517
2 changed files with 20 additions and 4 deletions

View File

@@ -1311,7 +1311,7 @@ const PaperContainer = (
},
hollow.map((item: any) =>
item.map((p: any) => {
if (paper instanceof paper.Segment) {
if (p instanceof paper.Segment) {
return [
p.point.x / activeScale,
p.point.y / activeScale,
@@ -1376,8 +1376,10 @@ const PaperContainer = (
let findIndexInArr = arr.findIndex((v) => v[0] === id)
let oldData = arr.find((a) => a[0] === id)!
let arr2 = needCopyMap.get(needCopyCategoryIds[index])!
let copiedItem = arr2.find((b: any) => b[0] === id)
if (!copiedItem) return
let newData = {
...arr2.find((b: any) => b[0] === id),
...copiedItem[2],
uid: oldData[2].uid,
create_timestamp: oldData[2].create_timestamp,
first_modified_timestamp:
@@ -1444,7 +1446,21 @@ const PaperContainer = (
data.set(imageId, newCategoryMap)
}
} else {
data.set(imageId, needCopyMap)
let newCategoryMap = new Map()
for (let [key, needCopyItemsArr] of needCopyMap) {
let arr = needCopyItemsArr.map((item: any) => [
item[0],
item[1].map((path: any) =>
path.map(([x, y]: any) => [x * picScale, y * picScale])
),
item[2],
item[3].map((path: any) =>
path.map(([x, y]: any) => [x * picScale, y * picScale])
),
])
newCategoryMap.set(key, arr)
}
data.set(imageId, newCategoryMap)
}
})
notifications.show({ message: "复制成功", color: "green" })

View File

@@ -1827,7 +1827,7 @@ const TopTools = (
</HoverCard.Dropdown>
</HoverCard>
<Box style={{ maxWidth: 300 }}>
<Text truncate="end" size="sm">
<Text truncate="end" size="sm" title={activeImage}>
{activeImage}
</Text>
</Box>