@@ -529,59 +529,28 @@ ${Object.keys(size)
529
529
return '' ;
530
530
}
531
531
532
- async scrollUntilTop ( startPoint ?: Point ) : Promise < void > {
533
- if ( startPoint ) {
534
- const start = { x : startPoint . left , y : startPoint . top } ;
535
- const end = { x : start . x , y : 0 } ;
536
-
537
- await this . mouseDrag ( start , end ) ;
538
- return ;
539
- }
540
-
532
+ async scrollUntilTop ( ) : Promise < void > {
541
533
await repeat ( defaultScrollUntilTimes , ( ) =>
542
534
this . mouseWheel ( 0 , 9999999 , defaultFastScrollDuration ) ,
543
535
) ;
544
536
await sleep ( 1000 ) ;
545
537
}
546
538
547
- async scrollUntilBottom ( startPoint ?: Point ) : Promise < void > {
548
- if ( startPoint ) {
549
- const { height } = await this . size ( ) ;
550
- const start = { x : startPoint . left , y : startPoint . top } ;
551
- const end = { x : start . x , y : height } ;
552
- await this . mouseDrag ( start , end ) ;
553
- return ;
554
- }
555
-
539
+ async scrollUntilBottom ( ) : Promise < void > {
556
540
await repeat ( defaultScrollUntilTimes , ( ) =>
557
541
this . mouseWheel ( 0 , - 9999999 , defaultFastScrollDuration ) ,
558
542
) ;
559
543
await sleep ( 1000 ) ;
560
544
}
561
545
562
- async scrollUntilLeft ( startPoint ?: Point ) : Promise < void > {
563
- if ( startPoint ) {
564
- const start = { x : startPoint . left , y : startPoint . top } ;
565
- const end = { x : 0 , y : start . y } ;
566
- await this . mouseDrag ( start , end ) ;
567
- return ;
568
- }
569
-
546
+ async scrollUntilLeft ( ) : Promise < void > {
570
547
await repeat ( defaultScrollUntilTimes , ( ) =>
571
548
this . mouseWheel ( 9999999 , 0 , defaultFastScrollDuration ) ,
572
549
) ;
573
550
await sleep ( 1000 ) ;
574
551
}
575
552
576
- async scrollUntilRight ( startPoint ?: Point ) : Promise < void > {
577
- if ( startPoint ) {
578
- const { width } = await this . size ( ) ;
579
- const start = { x : startPoint . left , y : startPoint . top } ;
580
- const end = { x : width , y : start . y } ;
581
- await this . mouseDrag ( start , end ) ;
582
- return ;
583
- }
584
-
553
+ async scrollUntilRight ( ) : Promise < void > {
585
554
await repeat ( defaultScrollUntilTimes , ( ) =>
586
555
this . mouseWheel ( - 9999999 , 0 , defaultFastScrollDuration ) ,
587
556
) ;
0 commit comments