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