diff --git a/B07_DesignDetail/openwebcad/src/App.consts.ts b/B07_DesignDetail/openwebcad/src/App.consts.ts index 1afeab60..22242cec 100644 --- a/B07_DesignDetail/openwebcad/src/App.consts.ts +++ b/B07_DesignDetail/openwebcad/src/App.consts.ts @@ -197,7 +197,7 @@ export const CANVAS_INPUT_FIELD_SELECTION_TEXT_COLOR = '#000'; /** * Canvas input field text size in pixels */ -export const CANVAS_INPUT_FIELD_FONT_SIZE = 16; +export const CANVAS_INPUT_FIELD_FONT_SIZE = 12; /** * Canvas input field instruction text color diff --git a/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts b/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts index 6e5c0683..2ec21f69 100644 --- a/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts +++ b/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts @@ -1,7 +1,9 @@ import { Point } from '@flatten-js/core'; import { compact, round } from 'es-toolkit'; +import { Actor } from 'xstate'; import { CANVAS_INPUT_FIELD_BACKGROUND_COLOR, + CANVAS_INPUT_FIELD_FONT_SIZE, CANVAS_INPUT_FIELD_HEIGHT, CANVAS_INPUT_FIELD_INSTRUCTION_TEXT_COLOR, CANVAS_INPUT_FIELD_MOUSE_OFFSET, @@ -39,6 +41,7 @@ import { getSnapPoint, getSnapPointOnAngleGuide, redo, + setActiveToolActor, setAngleStep, setGhostHelperEntities, setGridEnabled, @@ -50,7 +53,7 @@ import { undo, } from '../state.ts'; import { Tool } from '../tools.ts'; -import { SelectState } from '../tools/select-tool.ts'; +import { SelectState, selectToolStateMachine } from '../tools/select-tool.ts'; import { type AbsolutePointInputEvent, ActorEvent, @@ -139,7 +142,7 @@ export class InputController { { textAlign: 'left', textColor: CANVAS_INPUT_FIELD_TEXT_COLOR, - fontSize: 18, + fontSize: CANVAS_INPUT_FIELD_FONT_SIZE, } ); } @@ -496,10 +499,18 @@ export class InputController { text: this.text, activeTool: getActiveToolActor(), }); + const wasSelectTool = this.isSelectToolActive(); // Send the ENTER event to the active tool getActiveToolActor()?.send({ type: ActorEvent.ENTER, }); + // 선택 도구는 ENTER(우클릭)로 최종 상태에 들어가 **멈춘다**. 다른 도구가 선택을 + // 자식으로 불러 쓸 때는 그 끝남이 필요하지만(move·copy·rotate의 onDone), + // 선택이 그 자체로 활성 도구일 때 멈추면 커서 옆 안내가 사라지고 이후 클릭도 + // 안 먹는다(2026-08-30 사용자 지적). 그 경우에만 새로 세워 준다. + if (wasSelectTool && getActiveToolActor()?.getSnapshot()?.status === 'done') { + setActiveToolActor(new Actor(selectToolStateMachine)); + } } else if (activeToolCanHandleTextInput) { console.log('TEXT_INPUT: ', { text: this.text, @@ -643,7 +654,7 @@ export class InputController { { textAlign: 'left', textColor: CANVAS_INPUT_FIELD_INSTRUCTION_TEXT_COLOR, - fontSize: 18, + fontSize: CANVAS_INPUT_FIELD_FONT_SIZE, } ); });