레이어 수정

This commit is contained in:
dohyeons 2025-10-01 18:10:29 +09:00
parent 7d801c0a2b
commit ed908b2330
1 changed files with 5 additions and 3 deletions

View File

@ -783,7 +783,8 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin
setComponents((prev) =>
prev.map((c) => {
if (idsToUpdate.includes(c.id)) {
return { ...c, zIndex: minZIndex - 1 };
// zIndex는 최소 1로 제한 (0이면 캔버스 배경 뒤로 가버림)
return { ...c, zIndex: Math.max(1, minZIndex - 1) };
}
return c;
}),
@ -821,11 +822,12 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin
setComponents((prev) => {
const sorted = [...prev].sort((a, b) => a.zIndex - b.zIndex);
const updated = sorted.map((c, index) => ({ ...c, zIndex: index }));
const updated = sorted.map((c, index) => ({ ...c, zIndex: index + 1 }));
return updated.map((c) => {
if (idsToUpdate.includes(c.id)) {
return { ...c, zIndex: Math.max(c.zIndex - 1, 0) };
// zIndex는 최소 1로 제한
return { ...c, zIndex: Math.max(c.zIndex - 1, 1) };
}
return c;
});