| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8f4bb19 commit 225fb1b
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -972,7 +972,8 @@ function groupArrayElements(ctx, output, value) { | |||
| 972 | 972 | (totalLength / actualMax > 5 || maxLength <= 6)) { | |
| 973 | 973 | ||
| 974 | 974 | const approxCharHeights = 2.5; | |
| 975 | - const biasedMax = Math.max(actualMax - 4, 1); | ||
| 975 | + const averageBias = Math.sqrt(actualMax - totalLength / output.length); | ||
| 976 | + const biasedMax = Math.max(actualMax - 3 - averageBias, 1); | ||
| 976 | 977 | // Dynamically check how many columns seem possible. | |
| 977 | 978 | const columns = Math.min( | |
| 978 | 979 | // Ideally a square should be drawn. We expect a character to be about 2.5 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2252,14 +2252,12 @@ assert.strictEqual( | |||
| 2252 | 2252 | ||
| 2253 | 2253 | expected = [ | |
| 2254 | 2254 | '[', | |
| 2255 | - ' 1, 1, 1,', | ||
| 2256 | - ' 1, 1, 1,', | ||
| 2257 | - ' 1, 1, 1,', | ||
| 2258 | - ' 1, 1, 1,', | ||
| 2259 | - ' 1, 1, 1,', | ||
| 2260 | - ' 1, 1, 1,', | ||
| 2261 | - ' 1, 1, 1,', | ||
| 2262 | - ' 1, 1, 1,', | ||
| 2255 | + ' 1, 1, 1, 1,', | ||
| 2256 | + ' 1, 1, 1, 1,', | ||
| 2257 | + ' 1, 1, 1, 1,', | ||
| 2258 | + ' 1, 1, 1, 1,', | ||
| 2259 | + ' 1, 1, 1, 1,', | ||
| 2260 | + ' 1, 1, 1, 1,', | ||
| 2263 | 2261 | ' 1, 1, 123456789', | |
| 2264 | 2262 | ']' | |
| 2265 | 2263 | ].join('\n'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments