Fixes wonky canvas layer ordering & compositing

This commit is contained in:
psychedelicious 2022-11-14 00:22:44 +11:00 committed by blessedcoolant
parent 17b295871f
commit 5304ef504c
4 changed files with 47 additions and 42 deletions

File diff suppressed because one or more lines are too long

View File

@ -10,6 +10,7 @@
<<<<<<< refs/remotes/upstream/development
<<<<<<< refs/remotes/upstream/development
<<<<<<< refs/remotes/upstream/development
<<<<<<< refs/remotes/upstream/development
<<<<<<< refs/remotes/upstream/development
<script type="module" crossorigin src="./assets/index.a8ba2a6c.js"></script>
<link rel="stylesheet" href="./assets/index.40a72c80.css">
@ -28,6 +29,9 @@
=======
<script type="module" crossorigin src="./assets/index.7f5e02f1.js"></script>
>>>>>>> Outpainting tab loads to empty canvas instead of upload
=======
<script type="module" crossorigin src="./assets/index.c26f71e8.js"></script>
>>>>>>> Fixes wonky canvas layer ordering & compositing
<link rel="stylesheet" href="./assets/index.978b75a1.css">
>>>>>>> Builds fresh bundle
</head>

View File

@ -55,6 +55,7 @@ const canvasSelector = createSelector(
stageCoordinates,
tool,
isMovingStage,
shouldShowIntermediates,
} = currentCanvas;
const { shouldShowGrid } = outpaintingCanvas;
@ -87,6 +88,7 @@ const canvasSelector = createSelector(
tool,
isOnOutpaintingTab: activeTabName === 'outpainting',
isStaging,
shouldShowIntermediates,
};
},
{
@ -113,6 +115,7 @@ const IAICanvas = () => {
tool,
isOnOutpaintingTab,
isStaging,
shouldShowIntermediates,
} = useAppSelector(canvasSelector);
useCanvasHotkeys();
@ -176,31 +179,29 @@ const IAICanvas = () => {
</Layer>
<Layer
id={'image'}
id={'base'}
ref={canvasImageLayerRef}
listening={false}
imageSmoothingEnabled={false}
>
<IAICanvasObjectRenderer />
<IAICanvasIntermediateImage />
</Layer>
<Layer id={'mask'} visible={isMaskEnabled} listening={false}>
<IAICanvasMaskLines visible={true} listening={false} />
<IAICanvasMaskCompositer listening={false} />
</Layer>
<Layer id={'tool'}>
<Layer id="preview" imageSmoothingEnabled={false}>
{!isStaging && (
<>
<IAICanvasBoundingBox visible={shouldShowBoundingBox} />
<IAICanvasBrushPreview
visible={tool !== 'move'}
listening={false}
/>
</>
<IAICanvasBrushPreview
visible={tool !== 'move'}
listening={false}
/>
)}
</Layer>
<Layer imageSmoothingEnabled={false}>
{isStaging && <IAICanvasStagingArea />}
{shouldShowIntermediates && <IAICanvasIntermediateImage />}
{!isStaging && (
<IAICanvasBoundingBox visible={shouldShowBoundingBox} />
)}
</Layer>
</Stage>
{isOnOutpaintingTab && <IAICanvasStatusText />}

View File

@ -151,11 +151,11 @@ const IAICanvasMaskCompositer = (props: IAICanvasMaskCompositerProps) => {
if (
!(
fillPatternImage &&
stageCoordinates.x &&
stageCoordinates.y &&
stageScale &&
stageDimensions.width &&
stageDimensions.height
stageCoordinates.x !== undefined &&
stageCoordinates.y !== undefined &&
stageScale !== undefined &&
stageDimensions.width !== undefined &&
stageDimensions.height !== undefined
)
)
return null;