auto: 2026-09-28 17:00 (ESD_LAPTOP)
This commit is contained in:
@@ -11,6 +11,9 @@ import {
|
||||
SNAP_POINT_SIZE,
|
||||
} from '../App.consts';
|
||||
import { type SnapPoint, SnapPointType } from '../App.types';
|
||||
|
||||
/** 기준점 십자 반길이(px) — 가로세로 20px. */
|
||||
const ORIGIN_MARKER_SIZE = 10;
|
||||
import type { DrawController } from '../drawControllers/DrawController';
|
||||
import type { ScreenCanvasDrawController } from '../drawControllers/screenCanvas.drawController';
|
||||
import type { Entity } from '../entities/Entity';
|
||||
@@ -229,6 +232,23 @@ export function drawCursor(drawController: ScreenCanvasDrawController) {
|
||||
);
|
||||
}
|
||||
|
||||
/** 좌표 0,0 기준점 — 화면 크기 고정 십자 + 작은 원. 도면 개체가 아니라 그리기 겹판(저장 · 선택 · 스냅 대상 아님). */
|
||||
export function drawOriginMarker(drawController: ScreenCanvasDrawController) {
|
||||
const origin = drawController.worldToTarget(new Point(0, 0));
|
||||
drawController.setOpacity(0.6);
|
||||
drawController.setLineStyles(false, false, '#ffffff', 1, []); // 자동색 — 바탕 따라 흰/검정
|
||||
drawController.drawLineScreen(
|
||||
new Point(origin.x - ORIGIN_MARKER_SIZE, origin.y),
|
||||
new Point(origin.x + ORIGIN_MARKER_SIZE, origin.y)
|
||||
);
|
||||
drawController.drawLineScreen(
|
||||
new Point(origin.x, origin.y - ORIGIN_MARKER_SIZE),
|
||||
new Point(origin.x, origin.y + ORIGIN_MARKER_SIZE)
|
||||
);
|
||||
drawController.drawArcScreen(origin, ORIGIN_MARKER_SIZE / 3, 0, 2 * Math.PI, true);
|
||||
drawController.setOpacity(1);
|
||||
}
|
||||
|
||||
/** 선택한 객체의 그립(편집점)을 화면 크기 고정 사각형으로 그린다 */
|
||||
export function drawGrips(drawController: ScreenCanvasDrawController, entities: Entity[]) {
|
||||
for (const entity of entities) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
getShouldDrawCursor,
|
||||
getSnapPoint,
|
||||
getSnapPointOnAngleGuide,
|
||||
isOriginMarker,
|
||||
isViewOnly,
|
||||
} from '../state';
|
||||
import {
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
drawEntities,
|
||||
drawGrips,
|
||||
drawHelpers,
|
||||
drawOriginMarker,
|
||||
drawSnapPoint,
|
||||
} from './draw-functions';
|
||||
import { getClosestSnapPoint } from './get-closest-snap-point';
|
||||
@@ -48,6 +50,7 @@ export function draw(drawController: ScreenCanvasDrawController) {
|
||||
drawScene(drawController, performance.now());
|
||||
drawHighlightedEntities(drawController);
|
||||
|
||||
if (isOriginMarker()) drawOriginMarker(drawController);
|
||||
drawGrips(drawController, getSelectedEntities());
|
||||
drawHelpers(drawController, getAngleGuideEntities());
|
||||
drawEntities(drawController, getGhostHelperEntities());
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
setHostSave,
|
||||
setHostTitle,
|
||||
setLayers,
|
||||
setOriginMarker,
|
||||
setViewOnly,
|
||||
} from '../state.ts';
|
||||
import { setInspectorCollapsed, setRibbonCollapsed } from '../components/ui-state.ts';
|
||||
@@ -66,6 +67,7 @@ interface DrawingLoadMessage {
|
||||
panelsCollapsed?: boolean;
|
||||
/** 미리보기 — 왼쪽 끌기 = 화면 옮기기 · 두 번 누름 = 전체 맞춤 · 선택 · 명령 안내 없음. */
|
||||
viewOnly?: boolean;
|
||||
originMarker?: boolean;
|
||||
}
|
||||
|
||||
interface DrawingSaveRequestMessage {
|
||||
@@ -223,6 +225,7 @@ export function registerAisloDrawingBridge() {
|
||||
setRibbonCollapsed(event.data.ribbonCollapsed === true);
|
||||
if (event.data.panelsCollapsed) setInspectorCollapsed(true);
|
||||
setViewOnly(event.data.viewOnly === true);
|
||||
setOriginMarker(event.data.originMarker === true);
|
||||
if (event.data.frameEdit) applyFramePreview();
|
||||
// 앞 도면에서 켜 둔 그리기 도구를 내린다. 안 내리면 **확정한 도면 위에도**
|
||||
// 그 도구가 계속 그린다 — 읽기 전용은 새 명령만 막기 때문이다(2026-09-01 실측:
|
||||
|
||||
@@ -194,6 +194,7 @@ let frameFields: Record<string, string> = {};
|
||||
let hostReadOnly = false;
|
||||
/** 미리보기(M02 집계표 카드) — 왼쪽 끌기 = 화면 옮기기 · 두 번 누름 = 전체 맞춤 · 선택 · 명령 안내 없음. */
|
||||
let viewOnly = false;
|
||||
let originMarker = false;
|
||||
let hostTitle = 'B07 상세 설계';
|
||||
let hostSave = false;
|
||||
|
||||
@@ -275,6 +276,8 @@ export const isDrawingDirty = () => drawingDirty;
|
||||
*/
|
||||
export const isDrawingReadOnly = (): boolean => designMeta?.confirmed === true || hostReadOnly;
|
||||
export const isViewOnly = (): boolean => viewOnly;
|
||||
/** 좌표 0,0 기준점 십자를 그리는가 — 그리기 겹판일 뿐 도면 개체가 아니다. */
|
||||
export const isOriginMarker = (): boolean => originMarker;
|
||||
|
||||
// setters
|
||||
export const setCanvas = (newCanvas: HTMLCanvasElement) => {
|
||||
@@ -518,6 +521,10 @@ export const setHostReadOnly = (readOnly: boolean) => {
|
||||
hostReadOnly = readOnly;
|
||||
notifyWindow(HtmlEvent.UPDATE_STATE);
|
||||
};
|
||||
export const setOriginMarker = (enabled: boolean) => {
|
||||
originMarker = enabled;
|
||||
notifyWindow(HtmlEvent.UPDATE_STATE);
|
||||
};
|
||||
export const setViewOnly = (enabled: boolean) => {
|
||||
viewOnly = enabled;
|
||||
// 그리는 십자 커서 대신 손 모양 — 캔버스는 `cursor-none` 이라 안 두면 커서가 안 보임.
|
||||
|
||||
Reference in New Issue
Block a user