resize: Increase minimum height for left sidebar blocks.

This function is only called to calculate the size of stream and
user list. Using 250px as minimum height for these blocks gives
them enough space to be usable regardless of their height ratio.
This commit is contained in:
Aman Agrawal
2022-11-05 08:23:18 +00:00
committed by Tim Abbott
parent b6a9819395
commit 244be5b71b

View File

@@ -36,7 +36,12 @@ function size_blocks(blocks, usable_height) {
for (const block of blocks) {
let ratio = block.real_height / sum_height;
ratio = confine_to_range(0.05, ratio, 0.85);
block.max_height = confine_to_range(80, usable_height * ratio, 1.2 * block.real_height);
const min_block_height = Math.min(250, usable_height / blocks.length, block.real_height);
block.max_height = confine_to_range(
min_block_height,
usable_height * ratio,
1.2 * block.real_height,
);
}
}