-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: modify scroll bar size * test: modify test case --------- Co-authored-by: 二货机器人 <[email protected]>
- Loading branch information
Showing
4 changed files
with
5 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
const MIN_SIZE = 20; | ||
|
||
export function getSpinSize(containerSize = 0, scrollRange = 0) { | ||
let baseSize = (containerSize / scrollRange) * 100; | ||
let baseSize = (containerSize / scrollRange) * containerSize; | ||
if (isNaN(baseSize)) { | ||
baseSize = 0; | ||
} | ||
baseSize = Math.max(baseSize, MIN_SIZE); | ||
baseSize = Math.min(baseSize, containerSize / 2); | ||
return Math.floor(baseSize); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters