mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): no objects rendered until vis toggled
This commit is contained in:
parent
9378656d78
commit
340af1fe50
@ -117,6 +117,6 @@ export class CanvasInpaintMask {
|
|||||||
updateVisibility = (arg?: { isEnabled: boolean }) => {
|
updateVisibility = (arg?: { isEnabled: boolean }) => {
|
||||||
this.log.trace('Updating visibility');
|
this.log.trace('Updating visibility');
|
||||||
const isEnabled = get(arg, 'isEnabled', this.state.isEnabled);
|
const isEnabled = get(arg, 'isEnabled', this.state.isEnabled);
|
||||||
this.konva.layer.visible(isEnabled && this.renderer.hasObjects());
|
this.konva.layer.visible(isEnabled);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,9 @@ export class CanvasLayer {
|
|||||||
this.log.debug('Updating');
|
this.log.debug('Updating');
|
||||||
const { position, objects, opacity, isEnabled } = state;
|
const { position, objects, opacity, isEnabled } = state;
|
||||||
|
|
||||||
|
if (this.isFirstRender || isEnabled !== this.state.isEnabled) {
|
||||||
|
this.updateVisibility({ isEnabled });
|
||||||
|
}
|
||||||
if (this.isFirstRender || objects !== this.state.objects) {
|
if (this.isFirstRender || objects !== this.state.objects) {
|
||||||
await this.updateObjects({ objects });
|
await this.updateObjects({ objects });
|
||||||
}
|
}
|
||||||
@ -79,9 +82,6 @@ export class CanvasLayer {
|
|||||||
if (this.isFirstRender || opacity !== this.state.opacity) {
|
if (this.isFirstRender || opacity !== this.state.opacity) {
|
||||||
this.updateOpacity({ opacity });
|
this.updateOpacity({ opacity });
|
||||||
}
|
}
|
||||||
if (this.isFirstRender || isEnabled !== this.state.isEnabled) {
|
|
||||||
this.updateVisibility({ isEnabled });
|
|
||||||
}
|
|
||||||
// this.transformer.syncInteractionState();
|
// this.transformer.syncInteractionState();
|
||||||
|
|
||||||
if (this.isFirstRender) {
|
if (this.isFirstRender) {
|
||||||
@ -95,7 +95,7 @@ export class CanvasLayer {
|
|||||||
updateVisibility = (arg?: { isEnabled: boolean }) => {
|
updateVisibility = (arg?: { isEnabled: boolean }) => {
|
||||||
this.log.trace('Updating visibility');
|
this.log.trace('Updating visibility');
|
||||||
const isEnabled = get(arg, 'isEnabled', this.state.isEnabled);
|
const isEnabled = get(arg, 'isEnabled', this.state.isEnabled);
|
||||||
this.konva.layer.visible(isEnabled && this.renderer.hasObjects());
|
this.konva.layer.visible(isEnabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateObjects = async (arg?: { objects: CanvasLayerState['objects'] }) => {
|
updateObjects = async (arg?: { objects: CanvasLayerState['objects'] }) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user