Skip to content

Commit

Permalink
Apply automatic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ykevu authored and github-actions[bot] committed Sep 21, 2022
1 parent 38b1f29 commit b354a5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/src/Project/EditControls/EditTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function EditTabs() {
}
};
// Bind 'z' for edge case where Undo triggers DISPLAY
bind('z', () => labelMode.send('DISPLAY'));
bind('z', () => labelMode.send('DISPLAY'));
document.addEventListener('keydown', listener);
return () => {
document.removeEventListener('keydown', listener);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Project/service/canvasMachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const createCanvasMachine = ({ undoRef, eventBuses }) =>
panOnDrag: {
on: {
SET_PAN_ON_DRAG: { target: 'checkDrag', actions: 'setPanOnDrag' },
RESTORE_DRAG: { target: 'checkDrag' }
RESTORE_DRAG: { target: 'checkDrag' },
},
initial: 'idle',
states: {
Expand Down Expand Up @@ -119,7 +119,7 @@ const createCanvasMachine = ({ undoRef, eventBuses }) =>
mouseup: { actions: 'sendToEventBus' },
mousemove: { actions: 'computeCoordinates' },
SET_PAN_ON_DRAG: { target: 'checkDrag', actions: 'setPanOnDrag' },
RESTORE_DRAG: { target: 'checkDrag' }
RESTORE_DRAG: { target: 'checkDrag' },
},
},
},
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/Project/service/edit/editMachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ const createEditMachine = ({ eventBuses, undoRef }) =>
},
},
editSegment: {
entry: [
assign({ tool: 'editSegment' }),
send({ type: 'ENTER_TAB' }),
],
entry: [assign({ tool: 'editSegment' }), send({ type: 'ENTER_TAB' })],
on: {
mouseup: { actions: forwardTo('editSegment') },
mousedown: { actions: forwardTo('editSegment') },
Expand Down Expand Up @@ -106,7 +103,7 @@ const createEditMachine = ({ eventBuses, undoRef }) =>
EDIT_SPOTS: 'editSpots',

SET_PAN_ON_DRAG: { actions: forwardTo('canvas') },
ENTER_TAB: { actions: forwardTo('editSegment') }
ENTER_TAB: { actions: forwardTo('editSegment') },
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,16 @@ const createEditSegmentMachine = (context) =>
entry: 'setPanOnDragTrue',
on: {
// Undo edge case can cause POD=False in this state, so must reset in this case.
SET_TOOL: [{ cond: 'isNoPanTool', target: 'noPan' }, {actions: 'setPanOnDragTrue'}],
SET_TOOL: [
{ cond: 'isNoPanTool', target: 'noPan' },
{ actions: 'setPanOnDragTrue' },
],
},
},
noPan: {
entry: 'setPanOnDragFalse',
on: {
SET_TOOL: [{ cond: 'isPanTool', target: 'pan' }, {actions: 'setPanOnDragFalse'}],
SET_TOOL: [{ cond: 'isPanTool', target: 'pan' }, { actions: 'setPanOnDragFalse' }],
// Set POD=False when switching from other tab
ENTER_TAB: { actions: 'setPanOnDragFalse' },
},
Expand Down

0 comments on commit b354a5c

Please sign in to comment.