context menu 폰트 설정 기능 수정
This commit is contained in:
parent
499e75b981
commit
64cd0ca1f3
@ -33,6 +33,7 @@ import RowInsert from '@/components/floor-plan/modal/module/row/RowInsert'
|
||||
import CircuitNumberEdit from '@/components/floor-plan/modal/module/CircuitNumberEdit'
|
||||
import { useObjectBatch } from '@/hooks/object/useObjectBatch'
|
||||
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
||||
import { fontSelector, globalFontAtom } from '@/store/fontAtom'
|
||||
|
||||
export function useContextMenu() {
|
||||
const currentMenu = useRecoilValue(currentMenuState) // 현재 메뉴
|
||||
@ -51,6 +52,9 @@ export function useContextMenu() {
|
||||
const { handleZoomClear } = useCanvasEvent()
|
||||
const { moveObjectBatch } = useObjectBatch({})
|
||||
const { moveSurfaceShapeBatch } = useSurfaceShapeBatch()
|
||||
const [globalFont, setGlobalFont] = useRecoilState(globalFontAtom)
|
||||
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
||||
|
||||
const currentMenuSetting = () => {
|
||||
switch (currentMenu) {
|
||||
case MENU.PLAN_DRAWING:
|
||||
@ -417,7 +421,26 @@ export function useContextMenu() {
|
||||
{
|
||||
id: 'commonTextFontSetting',
|
||||
name: getMessage('contextmenu.font.setting'),
|
||||
component: <FontSetting id={popupId} type={'commonText'} />,
|
||||
component: (
|
||||
<FontSetting
|
||||
id={popupId}
|
||||
type={'commonText'}
|
||||
font={commonTextFont}
|
||||
onSave={(font) => {
|
||||
setGlobalFont((prev) => {
|
||||
return {
|
||||
...prev,
|
||||
commonText: {
|
||||
fontFamily: font.fontFamily,
|
||||
fontWeight: font.fontWeight,
|
||||
fontSize: font.fontSize,
|
||||
fontColor: font.fontColor,
|
||||
},
|
||||
}
|
||||
})
|
||||
}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'commonTextEdit',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user