fix(ui): bbox interactability

This commit is contained in:
psychedelicious
2024-09-14 11:42:53 +10:00
parent ae7440b721
commit d9cb718e33
2 changed files with 8 additions and 3 deletions

View File

@@ -173,6 +173,9 @@ export class CanvasBboxModule extends CanvasModuleBase {
// Listen for the bbox overlay setting to update the overlay's visibility
this.subscriptions.add(this.manager.stateApi.createStoreSubscription(selectBboxOverlay, this.render));
// Update on busy state changes
this.subscriptions.add(this.manager.$isBusy.listen(this.render));
}
initialize = () => {

View File

@@ -141,19 +141,21 @@ export class CanvasToolModule extends CanvasModuleBase {
if (tool === 'view') {
stage.setCursor(isMouseDown ? 'grabbing' : 'grab');
} else if (this.manager.stateApi.getRenderedEntityCount() === 0) {
stage.setCursor('not-allowed');
} else if (this.manager.stateApi.$isTransforming.get()) {
stage.setCursor('default');
} else if (this.manager.stateApi.$isFiltering.get()) {
stage.setCursor('not-allowed');
} else if (this.manager.stagingArea.$isStaging.get()) {
stage.setCursor('not-allowed');
} else if (tool === 'bbox') {
stage.setCursor('default');
} else if (this.manager.stateApi.getRenderedEntityCount() === 0) {
stage.setCursor('not-allowed');
} else if (!this.manager.stateApi.getSelectedEntityAdapter()?.$isInteractable.get()) {
stage.setCursor('not-allowed');
} else if (tool === 'colorPicker' || tool === 'brush' || tool === 'eraser') {
stage.setCursor('none');
} else if (tool === 'move' || tool === 'bbox') {
} else if (tool === 'move') {
stage.setCursor('default');
} else if (tool === 'rect') {
stage.setCursor('crosshair');