fix(copy): fix
This commit is contained in:
@@ -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" })
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user