mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2025-12-24 06:58:48 -05:00
feat: enable panning by dragging on empty space with left mouse button
This commit is contained in:
@@ -142,6 +142,15 @@ export const Cursor: ModeActions = {
|
||||
items: [item],
|
||||
isInitialMovement: true
|
||||
});
|
||||
} else {
|
||||
// If no item is being dragged and the mouse has moved, switch to PAN mode
|
||||
// Only do this if the drag started on empty space
|
||||
if (uiState.mouse.mousedown) {
|
||||
uiState.actions.setMode({
|
||||
type: 'PAN',
|
||||
showCursor: false
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mousedown,
|
||||
|
||||
@@ -27,7 +27,13 @@ export const Pan: ModeActions = {
|
||||
|
||||
setWindowCursor('grabbing');
|
||||
},
|
||||
mouseup: () => {
|
||||
mouseup: ({ uiState }) => {
|
||||
setWindowCursor('grab');
|
||||
// Always revert to CURSOR mode after panning
|
||||
uiState.actions.setMode({
|
||||
type: 'CURSOR',
|
||||
showCursor: true,
|
||||
mousedownItem: null
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user