mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix Inpainting Canvas Rendering
This commit is contained in:
parent
6adebf065f
commit
82a53782d0
@ -1,7 +1,7 @@
|
||||
// lib
|
||||
import { MutableRefObject, useEffect, useRef, useState } from 'react';
|
||||
import Konva from 'konva';
|
||||
import { Layer, Stage } from 'react-konva';
|
||||
import { Group, Layer, Stage } from 'react-konva';
|
||||
import { Image as KonvaImage } from 'react-konva';
|
||||
import { Stage as StageType } from 'konva/lib/Stage';
|
||||
|
||||
@ -233,30 +233,31 @@ const IAICanvas = () => {
|
||||
<IAICanvasOutpaintingObjects />
|
||||
<IAICanvasIntermediateImage />
|
||||
</Layer>
|
||||
<Layer id={'mask-layer'} visible={isMaskEnabled} listening={false}>
|
||||
<IAICanvasMaskLines visible={true} listening={false} />
|
||||
<Layer id={'mask-layer'} listening={false}>
|
||||
<IAICanvasMaskLines visible={isMaskEnabled} listening={false} />
|
||||
|
||||
<IAICanvasMaskCompositer listening={false} />
|
||||
<IAICanvasMaskCompositer
|
||||
listening={false}
|
||||
globalCompositeOperation="source-in"
|
||||
/>
|
||||
|
||||
{canvasBgImage && (
|
||||
<>
|
||||
<KonvaImage
|
||||
image={canvasBgImage}
|
||||
listening={false}
|
||||
globalCompositeOperation="source-in"
|
||||
visible={shouldInvertMask}
|
||||
/>
|
||||
|
||||
<KonvaImage
|
||||
image={canvasBgImage}
|
||||
listening={false}
|
||||
globalCompositeOperation="source-out"
|
||||
visible={
|
||||
!shouldInvertMask && shouldShowCheckboardTransparency
|
||||
}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Group globalCompositeOperation="destination-over">
|
||||
{canvasBgImage && (
|
||||
<>
|
||||
<KonvaImage
|
||||
image={canvasBgImage}
|
||||
listening={false}
|
||||
visible={!shouldInvertMask}
|
||||
/>
|
||||
<KonvaImage
|
||||
image={canvasBgImage}
|
||||
listening={false}
|
||||
globalCompositeOperation="source-in"
|
||||
visible={shouldInvertMask}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Group>
|
||||
</Layer>
|
||||
<Layer id={'preview-layer'}>
|
||||
<IAICanvasBoundingBoxPreview visible={shouldShowBoundingBox} />
|
||||
|
@ -39,7 +39,7 @@ const IAICanvasMaskCompositer = (props: IAICanvasMaskCompositerProps) => {
|
||||
height={stageDimensions.height / stageScale}
|
||||
width={stageDimensions.width / stageScale}
|
||||
fill={maskColorString}
|
||||
globalCompositeOperation={'source-in'}
|
||||
globalCompositeOperation={'source-over'}
|
||||
listening={false}
|
||||
{...rest}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user