diff --git a/src/modules/simulationRenderer/classes/SimulationRenderer.ts b/src/modules/simulationRenderer/classes/SimulationRenderer.ts index 3c65033..a44ae22 100644 --- a/src/modules/simulationRenderer/classes/SimulationRenderer.ts +++ b/src/modules/simulationRenderer/classes/SimulationRenderer.ts @@ -9,7 +9,11 @@ import { import { vector2 } from '../../../common/math/types/vector2' import { relativeTo, add, invert } from '../../vector2/helpers/basic' import { SimulationRendererOptions } from '../types/SimulationRendererOptions' -import { defaultSimulationRendererOptions, mouseButtons } from '../constants' +import { + defaultSimulationRendererOptions, + mouseButtons, + shiftInput +} from '../constants' import { getPinPosition } from '../helpers/pinPosition' import { pointInCircle } from '../../../common/math/helpers/pointInCircle' import { SelectedPins } from '../types/SelectedPins' @@ -177,7 +181,7 @@ export class SimulationRenderer { } } - if (event.button === mouseButtons.unselect) { + if (!shiftInput.value && event.button === mouseButtons.unselect) { this.clearSelection() } diff --git a/src/modules/simulationRenderer/constants.ts b/src/modules/simulationRenderer/constants.ts index 03b9857..6645f8c 100644 --- a/src/modules/simulationRenderer/constants.ts +++ b/src/modules/simulationRenderer/constants.ts @@ -1,6 +1,7 @@ import { SimulationRendererOptions } from './types/SimulationRendererOptions' import { vector2 } from '../../common/math/classes/Transform' import { mouseButton } from '../core/types/mouseButton' +import { KeyboardInput } from '../keybindings/classes/KeyboardInput' export const defaultSimulationRendererOptions: SimulationRendererOptions = { dnd: { @@ -46,3 +47,5 @@ export const mouseButtons: Record< select: 0, unselect: 0 } + +export const shiftInput = new KeyboardInput('shift')