style(code): format
This commit is contained in:
@@ -499,9 +499,7 @@ const PaperContainer = (
|
|||||||
showTags,
|
showTags,
|
||||||
showTagsConfigs,
|
showTagsConfigs,
|
||||||
} = useTopToolsStore()
|
} = useTopToolsStore()
|
||||||
const showShortcutGuide = useKeyboardStore(
|
const showShortcutGuide = useKeyboardStore((state) => state.showShortcutGuide)
|
||||||
(state) => state.showShortcutGuide
|
|
||||||
)
|
|
||||||
const shortcutGuidePosition = useKeyboardStore(
|
const shortcutGuidePosition = useKeyboardStore(
|
||||||
(state) => state.shortcutGuidePosition
|
(state) => state.shortcutGuidePosition
|
||||||
)
|
)
|
||||||
@@ -4311,13 +4309,21 @@ const PaperContainer = (
|
|||||||
border:
|
border:
|
||||||
"1px solid light-dark(rgba(34,139,230,0.12), rgba(114,192,252,0.14))",
|
"1px solid light-dark(rgba(34,139,230,0.12), rgba(114,192,252,0.14))",
|
||||||
}}>
|
}}>
|
||||||
<Group justify="space-between" align="flex-start" gap="xs" wrap="nowrap">
|
<Group
|
||||||
|
justify="space-between"
|
||||||
|
align="flex-start"
|
||||||
|
gap="xs"
|
||||||
|
wrap="nowrap">
|
||||||
<Box>
|
<Box>
|
||||||
<Text fw={700} size="sm">
|
<Text fw={700} size="sm">
|
||||||
快捷键说明
|
快捷键说明
|
||||||
</Text>
|
</Text>
|
||||||
<Text size="10px" c="dimmed" style={{ lineHeight: 1.35 }}>
|
<Text size="10px" c="dimmed" style={{ lineHeight: 1.35 }}>
|
||||||
默认靠左显示,可拖动;按 <Text component="span" fw={700}>?</Text> 快速开关
|
默认靠左显示,可拖动;按{" "}
|
||||||
|
<Text component="span" fw={700}>
|
||||||
|
?
|
||||||
|
</Text>{" "}
|
||||||
|
快速开关
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
@@ -64,12 +64,10 @@ export const useKeyboardStore = create<KeyboardStore>()(
|
|||||||
[sectionId]: !state.shortcutGuideCollapsedSections[sectionId],
|
[sectionId]: !state.shortcutGuideCollapsedSections[sectionId],
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
setDrawAction: (mode) =>
|
setDrawAction: (mode) => set((state) => ({ ...state, drawAction: mode })),
|
||||||
set((state) => ({ ...state, drawAction: mode })),
|
|
||||||
setSelectedObjectEditTarget: (target) =>
|
setSelectedObjectEditTarget: (target) =>
|
||||||
set((state) => ({ ...state, selectedObjectEditTarget: target })),
|
set((state) => ({ ...state, selectedObjectEditTarget: target })),
|
||||||
setCopyDataIds: (ids) =>
|
setCopyDataIds: (ids) => set((state) => ({ ...state, copyDataIds: ids })),
|
||||||
set((state) => ({ ...state, copyDataIds: ids })),
|
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: "keyboard-store",
|
name: "keyboard-store",
|
||||||
|
|||||||
@@ -902,9 +902,7 @@ const isPaperObjectType = (type: unknown) =>
|
|||||||
typeof type === "string" &&
|
typeof type === "string" &&
|
||||||
PAPER_OBJECT_TYPES.includes(type as (typeof PAPER_OBJECT_TYPES)[number])
|
PAPER_OBJECT_TYPES.includes(type as (typeof PAPER_OBJECT_TYPES)[number])
|
||||||
|
|
||||||
const syncPaperObjectStrokeScaling = (
|
const syncPaperObjectStrokeScaling = (item: paper.Item | null | undefined) => {
|
||||||
item: paper.Item | null | undefined
|
|
||||||
) => {
|
|
||||||
if (!(item instanceof paper.Path || item instanceof paper.CompoundPath)) {
|
if (!(item instanceof paper.Path || item instanceof paper.CompoundPath)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -947,9 +945,13 @@ export const ensureEditablePaperPathSelected = (objectId: number) => {
|
|||||||
|
|
||||||
if (!objectPaths.length) return null
|
if (!objectPaths.length) return null
|
||||||
|
|
||||||
const editablePaths = objectPaths.filter((item) => !item.data?.isHollowPolygon)
|
const editablePaths = objectPaths.filter(
|
||||||
|
(item) => !item.data?.isHollowPolygon
|
||||||
|
)
|
||||||
const activePath =
|
const activePath =
|
||||||
editablePaths.find((item) => item.data?.selected) || editablePaths[0] || null
|
editablePaths.find((item) => item.data?.selected) ||
|
||||||
|
editablePaths[0] ||
|
||||||
|
null
|
||||||
|
|
||||||
objectPaths.forEach((item) => {
|
objectPaths.forEach((item) => {
|
||||||
item.data.selected = item === activePath
|
item.data.selected = item === activePath
|
||||||
@@ -6721,12 +6723,7 @@ export const usePaperStore = create<PaperState>((set) => ({
|
|||||||
}
|
}
|
||||||
return circle
|
return circle
|
||||||
},
|
},
|
||||||
getBuffPath: (
|
getBuffPath: (item: paper.Segment, index: number, id: number, color: any) => {
|
||||||
item: paper.Segment,
|
|
||||||
index: number,
|
|
||||||
id: number,
|
|
||||||
color: any
|
|
||||||
) => {
|
|
||||||
if (!item.next) return null
|
if (!item.next) return null
|
||||||
const hitStrokeColor = clonePaperColor(color) || new paper.Color("#fff")
|
const hitStrokeColor = clonePaperColor(color) || new paper.Color("#fff")
|
||||||
hitStrokeColor.alpha = 0.001
|
hitStrokeColor.alpha = 0.001
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import paper from "paper"
|
import paper from "paper"
|
||||||
import { useLabelStore, useObjectStore } from "../store"
|
import { useLabelStore, useObjectStore } from "../store"
|
||||||
import { useOtherToolsStore } from "../useOtherToolsStore"
|
import { useOtherToolsStore } from "../useOtherToolsStore"
|
||||||
import { ensureEditablePaperPathSelected, usePaperStore } from "../usePaperStore"
|
import {
|
||||||
|
ensureEditablePaperPathSelected,
|
||||||
|
usePaperStore,
|
||||||
|
} from "../usePaperStore"
|
||||||
import { usePaperSupportStore } from "../usePaperSupportStore"
|
import { usePaperSupportStore } from "../usePaperSupportStore"
|
||||||
import { useTopToolsStore } from "../useTopToolsStore"
|
import { useTopToolsStore } from "../useTopToolsStore"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user