레이어 수정
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user