mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-12 12:35:01 -05:00
setting bbox visibility moved into render method
This commit is contained in:
committed by
psychedelicious
parent
1e9e78089e
commit
04572c94ad
@@ -198,7 +198,7 @@ export class CanvasBboxToolModule extends CanvasModuleBase {
|
||||
this.subscriptions.add(this.manager.$isBusy.listen(this.render));
|
||||
|
||||
// Listen for stage changes to update the bbox's visibility
|
||||
this.subscriptions.add(this.$isBboxHidden.listen((isHidden) => this.konva.group.visible(!isHidden)));
|
||||
this.subscriptions.add(this.$isBboxHidden.listen(this.render));
|
||||
}
|
||||
|
||||
// This is a noop. The cursor is changed when the cursor enters or leaves the bbox.
|
||||
@@ -214,13 +214,15 @@ export class CanvasBboxToolModule extends CanvasModuleBase {
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders the bbox. The bbox is only visible when the tool is set to 'bbox'.
|
||||
* Renders the bbox.
|
||||
*/
|
||||
render = () => {
|
||||
const tool = this.manager.tool.$tool.get();
|
||||
|
||||
const { x, y, width, height } = this.manager.stateApi.runSelector(selectBbox).rect;
|
||||
|
||||
this.konva.group.visible(!this.$isBboxHidden.get());
|
||||
|
||||
// We need to reach up to the preview layer to enable/disable listening so that the bbox can be interacted with.
|
||||
// If the mangaer is busy, we disable listening so the bbox cannot be interacted with.
|
||||
this.konva.group.listening(tool === 'bbox' && !this.manager.$isBusy.get());
|
||||
|
||||
Reference in New Issue
Block a user