refactor(CAD): 337-6 가 끝 몫 — 옛 OFFSET · LENGTHEN · 옛 꼴 통과 지움 · ALL · L · P 실제 고름 시험 · 안내 글

- transform-acad: 고르기 물음 ALL · L · P = 「n개를 찾음, 총 m개」 · 다시 「객체 선택:」 · 빈 Enter = 고르기 끝(설계 1-4 · 2-15)
- transform-tools: 안 쓰는 옛 OFFSET · LENGTHEN 머신 지움(새 offset-tool · lengthen-tool 이 대신)
- prompt-input · prompt · sequence-tool: 옛 꼴 통과(meta.options 글 배열 · TEXT_INPUT 대문자 통과 · chainFromLastPoint) 지움
- prompt-contract: 옛 꼴 안 쓰는지 지키는 시험 더함
- 안내 글(설계 4 장 끝): 오른쪽 단추 · 휠 두 번 · CAD 키 줄

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
This commit is contained in:
2026-10-16 00:34:02 +09:00
co-authored by Claude Opus 5.5
parent 746c70fcce
commit 933c4c5d71
7 changed files with 39 additions and 85 deletions
@@ -1,6 +1,5 @@
/** 대칭·정렬·간격띄우기·신축·길이조정 (조사표 2절) */
/** 대칭·정렬·신축 (조사표 2절) */
import { Box, Point, Polygon } from '@flatten-js/core';
import { toast } from 'react-toastify';
import { type AnyActorRef, assign } from 'xstate';
import { OPT } from '../../commands/prompt';
import type { Entity } from '../../entities/Entity';
@@ -21,7 +20,7 @@ import { createDisplaceTool } from '../move-tool';
import { SelectState } from '../select-tool';
import type { MouseClickEvent, StateEvent } from '../tool.types';
import { SELECT_CHILD } from '../transform.helpers';
import { copyStyle, lengthenLine, offsetEntity } from './modify.helpers';
import { copyStyle } from './modify.helpers';
/** 원본 특성을 유지한 복사본 */
const cloneStyled = (entity: Entity): Entity => copyStyle(entity, entity.clone());
@@ -110,23 +109,6 @@ export const alignToolStateMachine = createSequenceTool({
},
});
export const offsetToolStateMachine = createSequenceTool({
tool: Tool.OFFSET,
steps: [
{ kind: 'number', instructions: '간격띄우기 거리를 입력하십시오 <1>.', defaultValue: 1 },
{ kind: 'entity', instructions: '간격띄우기할 객체를 선택하십시오.' },
{ kind: 'point', instructions: '간격을 띄울 방향의 점을 지정하십시오.' },
],
commit: (input) => {
const result = offsetEntity(input.entity(1), input.number(0), input.point(2));
if (!result) {
toast.warn('이 객체는 지정한 거리로 간격을 띄울 수 없습니다.');
return;
}
addEntities([result], true);
},
});
/** 바꾼 것을 원본 자리에 — id · 묶음 · 꼴 그대로 */
const inPlaceOf = <T extends Entity>(source: Entity, made: T): T => {
copyStyle(source, made);
@@ -208,25 +190,3 @@ export const stretchToolStateMachine = createDisplaceTool({
return context.originals.flatMap((entity) => stretchEntity(entity, box, dx, dy) ?? []);
},
});
export const lengthenToolStateMachine = createSequenceTool({
tool: Tool.LENGTHEN,
steps: [
{ kind: 'entity', instructions: '길이를 바꿀 선을 늘릴 쪽 끝 근처에서 선택하십시오.' },
{
kind: 'number',
instructions: '증분 길이를 입력하십시오 (음수는 단축) <10>.',
defaultValue: 10,
},
],
commit: (input) => {
const entity = input.entity(0);
const changed = lengthenLine(entity, input.number(1), input.pick(0));
if (!changed) {
toast.warn('선만 길이를 조정할 수 있습니다.');
return;
}
deleteEntities([entity], false);
addEntities([changed], true);
},
});