|  | @@ -15,7 +15,7 @@ import {
 | 
											
												
													
														|  |  import {
 |  |  import {
 | 
											
												
													
														|  |    clearSelection,
 |  |    clearSelection,
 | 
											
												
													
														|  |    deleteSelectedElements,
 |  |    deleteSelectedElements,
 | 
											
												
													
														|  | -  setSelection,
 |  | 
 | 
											
												
													
														|  | 
 |  | +  getElementsWithinSelection,
 | 
											
												
													
														|  |    isOverScrollBars,
 |  |    isOverScrollBars,
 | 
											
												
													
														|  |    restoreFromLocalStorage,
 |  |    restoreFromLocalStorage,
 | 
											
												
													
														|  |    saveToLocalStorage,
 |  |    saveToLocalStorage,
 | 
											
										
											
												
													
														|  | @@ -510,11 +510,11 @@ export class App extends React.Component<{}, AppState> {
 | 
											
												
													
														|  |                  document.documentElement.style.cursor = `${resizeHandle}-resize`;
 |  |                  document.documentElement.style.cursor = `${resizeHandle}-resize`;
 | 
											
												
													
														|  |                  isResizingElements = true;
 |  |                  isResizingElements = true;
 | 
											
												
													
														|  |                } else {
 |  |                } else {
 | 
											
												
													
														|  | 
 |  | +                hitElement = getElementAtPosition(elements, x, y);
 | 
											
												
													
														|  |                  // clear selection if shift is not clicked
 |  |                  // clear selection if shift is not clicked
 | 
											
												
													
														|  | -                if (!e.shiftKey) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if (!hitElement?.isSelected && !e.shiftKey) {
 | 
											
												
													
														|  |                    elements = clearSelection(elements);
 |  |                    elements = clearSelection(elements);
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  | -                hitElement = getElementAtPosition(elements, x, y);
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  // If we click on something
 |  |                  // If we click on something
 | 
											
												
													
														|  |                  if (hitElement) {
 |  |                  if (hitElement) {
 | 
											
										
											
												
													
														|  | @@ -746,13 +746,23 @@ export class App extends React.Component<{}, AppState> {
 | 
											
												
													
														|  |                  this.state.scrollY;
 |  |                  this.state.scrollY;
 | 
											
												
													
														|  |                draggingElement.width = width;
 |  |                draggingElement.width = width;
 | 
											
												
													
														|  |                // Make a perfect square or circle when shift is enabled
 |  |                // Make a perfect square or circle when shift is enabled
 | 
											
												
													
														|  | -              draggingElement.height = e.shiftKey
 |  | 
 | 
											
												
													
														|  | -                ? Math.abs(width) * Math.sign(height)
 |  | 
 | 
											
												
													
														|  | -                : height;
 |  | 
 | 
											
												
													
														|  | 
 |  | +              draggingElement.height =
 | 
											
												
													
														|  | 
 |  | +                e.shiftKey && this.state.elementType !== "selection"
 | 
											
												
													
														|  | 
 |  | +                  ? Math.abs(width) * Math.sign(height)
 | 
											
												
													
														|  | 
 |  | +                  : height;
 | 
											
												
													
														|  |                draggingElement.shape = null;
 |  |                draggingElement.shape = null;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                if (this.state.elementType === "selection") {
 |  |                if (this.state.elementType === "selection") {
 | 
											
												
													
														|  | -                elements = setSelection(elements, draggingElement);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if (!e.shiftKey) {
 | 
											
												
													
														|  | 
 |  | +                  elements = clearSelection(elements);
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +                const elementsWithinSelection = getElementsWithinSelection(
 | 
											
												
													
														|  | 
 |  | +                  elements,
 | 
											
												
													
														|  | 
 |  | +                  draggingElement
 | 
											
												
													
														|  | 
 |  | +                );
 | 
											
												
													
														|  | 
 |  | +                elementsWithinSelection.forEach(element => {
 | 
											
												
													
														|  | 
 |  | +                  element.isSelected = true;
 | 
											
												
													
														|  | 
 |  | +                });
 | 
											
												
													
														|  |                }
 |  |                }
 | 
											
												
													
														|  |                // We don't want to save history when moving an element
 |  |                // We don't want to save history when moving an element
 | 
											
												
													
														|  |                history.skipRecording();
 |  |                history.skipRecording();
 |