fix(spreadsheet): C 격자 — 고름 테두리·채우기 손잡이 머리 칸만큼 겹쳐 밀리던 것 고침

overlay 가 이미 headColW·headRowH 만큼 밀려 있는데 renderSelection·setRefHighlights 가
screenBoxOf(격자 뿌리 기준)를 그대로 써서 두 번 밀렸다. overlay 안 전용 좌표 함수(overlayBoxOf)로
갈라 고침. M02 [스프레드시트 시험] 화면에서 ORCA 수치로 칸 자리와 정확히 일치함을 확인.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVM3xZ1aUPcUTuW2WZSnwg
This commit is contained in:
2026-09-27 21:11:12 +09:00
co-authored by Claude Sonnet 5
parent acdac34572
commit 69694a3f6b
+21 -9
View File
@@ -576,6 +576,20 @@ export function createGrid(ctx: SpreadsheetContext): GridHandle {
return { x, y, w: box.w, h: box.h };
}
/** `overlay` 안 자리 — `overlay` 자신이 이미 머리 칸(headColW·headRowH)만큼 밀려 있어
* `screenBoxOf`(격자 뿌리 기준)를 그대로 쓰면 머리 칸만큼 두 번 밀림(찾은 버그 · 2026-09-27). */
function overlayBoxOf(r: number, c: number): CellBox {
const box = boxOf(r, c);
const inFrozenCol = c < frozenCols;
const inFrozenRow = r < frozenRows;
return {
x: inFrozenCol ? box.x : box.x - paneBR.scrollLeft,
y: inFrozenRow ? box.y : box.y - paneBR.scrollTop,
w: box.w,
h: box.h,
};
}
function renderSelection(): void {
let selLayer = overlay.querySelector<HTMLElement>(".aislo-grid__sel-layer");
if (!selLayer) {
@@ -596,8 +610,8 @@ export function createGrid(ctx: SpreadsheetContext): GridHandle {
const inFrozenCol = range.c0 < frozenCols;
const inFrozenRow = range.r0 < frozenRows;
const screen: CellBox = {
x: headColW() + (inFrozenCol ? box.x : box.x - paneBR.scrollLeft),
y: headRowH() + (inFrozenRow ? box.y : box.y - paneBR.scrollTop),
x: inFrozenCol ? box.x : box.x - paneBR.scrollLeft,
y: inFrozenRow ? box.y : box.y - paneBR.scrollTop,
w: box.w,
h: box.h,
};
@@ -611,13 +625,11 @@ export function createGrid(ctx: SpreadsheetContext): GridHandle {
node.style.borderWidth = i === 0 ? "2px" : "1px";
selLayer!.append(node);
}
const active = boxOf(sel.활성.r, sel.활성.c);
const inFrozenCol = sel.활성.c < frozenCols;
const inFrozenRow = sel.활성.r < frozenRows;
const active = overlayBoxOf(sel.활성.r, sel.활성.c);
const handle = document.createElement("div");
handle.className = "aislo-grid__fill-handle";
handle.style.left = `${headColW() + (inFrozenCol ? active.x : active.x - paneBR.scrollLeft) + active.w - 4}px`;
handle.style.top = `${headRowH() + (inFrozenRow ? active.y : active.y - paneBR.scrollTop) + active.h - 4}px`;
handle.style.left = `${active.x + active.w - 4}px`;
handle.style.top = `${active.y + active.h - 4}px`;
selLayer!.append(handle);
}
@@ -643,8 +655,8 @@ export function createGrid(ctx: SpreadsheetContext): GridHandle {
const inFrozenRow = ref.범위.r0 < frozenRows;
const node = document.createElement("div");
node.className = "aislo-grid__ref-highlight";
node.style.left = `${headColW() + (inFrozenCol ? merged.x : merged.x - paneBR.scrollLeft)}px`;
node.style.top = `${headRowH() + (inFrozenRow ? merged.y : merged.y - paneBR.scrollTop)}px`;
node.style.left = `${inFrozenCol ? merged.x : merged.x - paneBR.scrollLeft}px`;
node.style.top = `${inFrozenRow ? merged.y : merged.y - paneBR.scrollTop}px`;
node.style.width = `${merged.w}px`;
node.style.height = `${merged.h}px`;
node.style.borderColor = REF_COLORS[ref.색번호 % REF_COLORS.length];