File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -828,12 +828,18 @@ namespace Private {
828
828
829
829
/**
830
830
* Find the drag scroll target under the mouse, if any.
831
+ *
832
+ * @param event - The mouse event related to the action.
833
+ *
834
+ * @param dragOffsetX - the number of pixels to offset the drag in the x direction.
835
+ *
836
+ * @param dragOffsetY - the number of pixels to offset the drag in the y direction.
831
837
*/
832
838
export
833
- function findScrollTarget ( event : MouseEvent , dragOffsetX : number , dragOffsetY : number ) : IScrollTarget | null {
839
+ function findScrollTarget ( event : MouseEvent , dragOffsetX ? : number , dragOffsetY ? : number ) : IScrollTarget | null {
834
840
// Look up the client mouse position.
835
- const x = event . clientX + dragOffsetX ;
836
- const y = event . clientY + dragOffsetY ;
841
+ const x = event . clientX + ( dragOffsetX !== undefined ? dragOffsetX : 0 ) ;
842
+ const y = event . clientY + ( dragOffsetY !== undefined ? dragOffsetY : 0 ) ;
837
843
838
844
// Get the element under the mouse.
839
845
let element : Element | null = document . elementFromPoint ( x , y ) ;
You can’t perform that action at this time.
0 commit comments