fix ccolor one page

This commit is contained in:
hamid zarghami
2026-05-06 14:53:55 +03:30
parent b1068eec26
commit 8717afbced
7 changed files with 77 additions and 30 deletions
+8 -6
View File
@@ -32,6 +32,8 @@ const EditorCanvas = ({ catalogSize }: EditorCanvasProps) => {
tool,
objects,
guides,
pages,
currentPageId,
selectedObjectId,
selectedObjectIds,
selectedCellId,
@@ -40,17 +42,17 @@ const EditorCanvas = ({ catalogSize }: EditorCanvasProps) => {
setLayerRef,
setGuides,
zoom,
documentSettings,
} = useEditorStore();
const currentPage = pages.find((page) => page.id === currentPageId);
const bgColor =
documentSettings.backgroundType === 'color'
? documentSettings.backgroundColor
currentPage?.backgroundType === 'color'
? currentPage.backgroundColor
: '#ffffff';
const [bgImage] = useImage(
documentSettings.backgroundType === 'image'
? documentSettings.backgroundImageUrl
currentPage?.backgroundType === 'image'
? (currentPage.backgroundImageUrl || '')
: '',
);
const stageSize = useStageSize(catalogSize);
@@ -394,7 +396,7 @@ const EditorCanvas = ({ catalogSize }: EditorCanvasProps) => {
fill={bgColor}
listening={false}
/>
{documentSettings.backgroundType === 'image' && bgImage && (
{currentPage?.backgroundType === 'image' && bgImage && (
<KonvaImage
image={bgImage}
x={0}