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