@@ -94,23 +94,25 @@ export const GestureScreen = observer(({ frame, isResizing }: { frame: Frame, is
9494 [ getRelativeMousePosition , editorEngine ] ,
9595 ) ;
9696
97- const throttledMouseMove = useMemo (
98- ( ) =>
99- throttle ( async ( e : React . MouseEvent < HTMLDivElement > ) => {
100-
101- if (
102- editorEngine . state . editorMode === EditorMode . DESIGN ||
103- ( ( editorEngine . state . editorMode === EditorMode . INSERT_DIV ||
104- editorEngine . state . editorMode === EditorMode . INSERT_TEXT ||
105- editorEngine . state . editorMode === EditorMode . INSERT_IMAGE ) &&
106- ! editorEngine . insert . isDrawing )
107- ) {
108- await handleMouseEvent ( e , MouseAction . MOVE ) ;
109- } else if ( editorEngine . insert . isDrawing ) {
110- editorEngine . insert . draw ( e ) ;
111- }
112- } , 16 ) ,
113- [ editorEngine , getRelativeMousePosition , handleMouseEvent ] ,
97+ const throttledMouseMove = useMemo ( ( ) =>
98+ throttle ( async ( e : React . MouseEvent < HTMLDivElement > ) => {
99+ // Skip hover events during drag selection
100+ if ( editorEngine . state . isDragSelecting ) {
101+ return ;
102+ }
103+ if (
104+ editorEngine . state . editorMode === EditorMode . DESIGN ||
105+ ( ( editorEngine . state . editorMode === EditorMode . INSERT_DIV ||
106+ editorEngine . state . editorMode === EditorMode . INSERT_TEXT ||
107+ editorEngine . state . editorMode === EditorMode . INSERT_IMAGE ) &&
108+ ! editorEngine . insert . isDrawing )
109+ ) {
110+ await handleMouseEvent ( e , MouseAction . MOVE ) ;
111+ } else if ( editorEngine . insert . isDrawing ) {
112+ editorEngine . insert . draw ( e ) ;
113+ }
114+ } , 16 ) ,
115+ [ editorEngine . state . isDragSelecting , editorEngine . state . editorMode , editorEngine . insert . isDrawing , getRelativeMousePosition , handleMouseEvent ] ,
114116 ) ;
115117
116118 useEffect ( ( ) => {
@@ -155,14 +157,12 @@ export const GestureScreen = observer(({ frame, isResizing }: { frame: Frame, is
155157 }
156158
157159 const handleDragOver = async ( e : React . DragEvent < HTMLDivElement > ) => {
158- // Disabled drag and drop functionality
159160 e . preventDefault ( ) ;
160161 e . stopPropagation ( ) ;
161162 await handleMouseEvent ( e , MouseAction . MOVE ) ;
162163 } ;
163164
164165 const handleDrop = async ( e : React . DragEvent < HTMLDivElement > ) => {
165- // Disabled drag and drop functionality
166166 e . preventDefault ( ) ;
167167 e . stopPropagation ( ) ;
168168
0 commit comments