mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
feat(floorplan-editor): hand tool joins the exclusive tool group, sits first in toolbar
Two related changes from the latest feedback: 1) Hand is now the FIRST button in the toolbar (left of the 'Modalita disegno' label), matching where users typically look for a pan affordance in painting / mapping editors. 2) The hand and the brush buttons form one exclusive tool group: picking any brush (SET / UNSET / UP / DOWN / DOOR) - or select-all / square-select - clears pan mode. No more 'I clicked SET but the canvas keeps panning'. Same goes the other way: clicking the hand stays sticky, and while it's active the brush highlights are visually de-selected even though state.brush.action still holds the last brush (so the user gets it back the moment they pick a brush again). Implementation: replaced the toolbar's onTogglePanMode prop with an imperative setPanMode(next: boolean) =>. Every other tool's onClick calls exitPan() first; the hand calls setPanMode(!panMode) directly. data-active and the border highlight on the brush + square-select buttons now require !panMode so the visual state mirrors the gesture state. No reducer changes - panMode stays a canvas-level UI flag.
This commit is contained in:
@@ -234,7 +234,7 @@ export const FloorplanEditorView: FC = () =>
|
||||
onUndo={ undo }
|
||||
onRedo={ redo }
|
||||
panMode={ panMode }
|
||||
onTogglePanMode={ () => setPanMode(v => !v) }
|
||||
setPanMode={ setPanMode }
|
||||
/>
|
||||
<FloorplanOptionsPanel state={ state } dispatch={ dispatch } />
|
||||
<Flex gap={ 2 } className="flex-1 min-h-0">
|
||||
|
||||
Reference in New Issue
Block a user