| 
														
															@@ -1,7 +1,7 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { ExcalidrawElement } from "../element/types"; 
														 | 
														
														 | 
														
															 import { ExcalidrawElement } from "../element/types"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import { getElementAbsoluteCoords } from "../element"; 
														 | 
														
														 | 
														
															 import { getElementAbsoluteCoords } from "../element"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-export function getElementsWithinSelection( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+export function setSelection( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   elements: readonly ExcalidrawElement[], 
														 | 
														
														 | 
														
															   elements: readonly ExcalidrawElement[], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   selection: ExcalidrawElement 
														 | 
														
														 | 
														
															   selection: ExcalidrawElement 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 ) { 
														 | 
														
														 | 
														
															 ) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -11,22 +11,22 @@ export function getElementsWithinSelection( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     selectionX2, 
														 | 
														
														 | 
														
															     selectionX2, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     selectionY2 
														 | 
														
														 | 
														
															     selectionY2 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   ] = getElementAbsoluteCoords(selection); 
														 | 
														
														 | 
														
															   ] = getElementAbsoluteCoords(selection); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-  return elements.filter(element => { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  elements.forEach(element => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     const [ 
														 | 
														
														 | 
														
															     const [ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       elementX1, 
														 | 
														
														 | 
														
															       elementX1, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       elementY1, 
														 | 
														
														 | 
														
															       elementY1, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       elementX2, 
														 | 
														
														 | 
														
															       elementX2, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       elementY2 
														 | 
														
														 | 
														
															       elementY2 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ] = getElementAbsoluteCoords(element); 
														 | 
														
														 | 
														
															     ] = getElementAbsoluteCoords(element); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    return ( 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    element.isSelected = 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       element.type !== "selection" && 
														 | 
														
														 | 
														
															       element.type !== "selection" && 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       selectionX1 <= elementX1 && 
														 | 
														
														 | 
														
															       selectionX1 <= elementX1 && 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       selectionY1 <= elementY1 && 
														 | 
														
														 | 
														
															       selectionY1 <= elementY1 && 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       selectionX2 >= elementX2 && 
														 | 
														
														 | 
														
															       selectionX2 >= elementX2 && 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      selectionY2 >= elementY2 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    ); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      selectionY2 >= elementY2; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   }); 
														 | 
														
														 | 
														
															   }); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  return elements; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 export function clearSelection(elements: readonly ExcalidrawElement[]) { 
														 | 
														
														 | 
														
															 export function clearSelection(elements: readonly ExcalidrawElement[]) { 
														 |