From 8ab10967cf9397a3e9aa0d11190073f283060832 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sun, 30 Aug 2026 21:27:53 +0900 Subject: [PATCH] =?UTF-8?q?fix(B07):=20=EC=84=A0=ED=83=9D=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=BD=EC=9D=B4=20=EC=84=A0=EB=B3=B4=EB=8B=A4=20=EC=95=84?= =?UTF-8?q?=EB=9E=98=EC=97=90=20=EC=B0=8D=ED=9E=88=EB=8D=98=20=EA=B2=83?= =?UTF-8?q?=EC=9D=84=20=EB=B0=94=EB=A1=9C=EC=9E=A1=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 화면 좌표는 아래에서 위로 재는 규약인데(getCanvasPoint·drawLineScreen), 화면 사각형 채우기만 캔버스 y로 옮길 때 높이를 빼지 않았다. 그래서 아래 변에 놓아야 할 사각형이 높이만큼 아래로 내려가, 선택 그립이 선보다 8px 밑에 찍혔다. 화면 픽셀 단위 어긋남이라 줌을 해도 간격이 그대로였다. 커서 옆 입력칸은 같은 함수를 쓰므로 자리가 유지되도록 높이만큼 내려 잡았다. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/drawControllers/screenCanvas.drawController.ts | 6 +++++- .../openwebcad/src/inputController/input-controller.ts | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/B07_DesignDetail/openwebcad/src/drawControllers/screenCanvas.drawController.ts b/B07_DesignDetail/openwebcad/src/drawControllers/screenCanvas.drawController.ts index c8946cab..a75f9ae8 100644 --- a/B07_DesignDetail/openwebcad/src/drawControllers/screenCanvas.drawController.ts +++ b/B07_DesignDetail/openwebcad/src/drawControllers/screenCanvas.drawController.ts @@ -647,7 +647,11 @@ export class ScreenCanvasDrawController implements DrawController { if (this.batching) this.flushBatch(); // TODO see if we need to replace this with a call to fillPolygon this.context.fillStyle = paintColor(color); - this.context.fillRect(xMin, this.canvasSize.y - yMin, width, height); + // 화면 좌표는 아래에서 위로 재는 규약이다(getCanvasPoint·drawLineScreen과 같다). + // yMin은 사각형의 아래 변이므로 캔버스 y로 옮길 때 높이를 함께 빼야 제자리다. + // 안 빼서 선택 그립이 선보다 8px 아래에 찍혔고, 줌을 해도 화면 픽셀 어긋남이라 + // 간격이 그대로였다(2026-08-30 사용자 지적). + this.context.fillRect(xMin, this.canvasSize.y - yMin - height, width, height); } /** diff --git a/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts b/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts index 2ec21f69..308ace26 100644 --- a/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts +++ b/B07_DesignDetail/openwebcad/src/inputController/input-controller.ts @@ -126,7 +126,9 @@ export class InputController { // draw input field drawController.fillRectScreen( screenMouseLocation.x + CANVAS_INPUT_FIELD_MOUSE_OFFSET, - screenMouseLocation.y - CANVAS_INPUT_FIELD_MOUSE_OFFSET, + // fillRectScreen이 아래 변 기준으로 바로잡혔으므로, 칸이 있던 자리를 지키려고 + // 높이만큼 내려 잡는다. + screenMouseLocation.y - CANVAS_INPUT_FIELD_MOUSE_OFFSET - CANVAS_INPUT_FIELD_HEIGHT, CANVAS_INPUT_FIELD_WIDTH, CANVAS_INPUT_FIELD_HEIGHT, CANVAS_INPUT_FIELD_BACKGROUND_COLOR