fix ccolor one page
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user