summaryrefslogtreecommitdiff
path: root/src/geom/fr.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-14 12:34:16 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-14 12:34:16 +0100
commitb9c0fd87d304942db315ca6fdbccddf233d045cd (patch)
treeae8231ab2999d44fd67cdba120a336704c4a6242 /src/geom/fr.rs
parentcc9b52ddd4defa3894ee3a4b28e411fa0b0991ba (diff)
Fix grid sizing
Diffstat (limited to 'src/geom/fr.rs')
-rw-r--r--src/geom/fr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/geom/fr.rs b/src/geom/fr.rs
index a737c953..c602634d 100644
--- a/src/geom/fr.rs
+++ b/src/geom/fr.rs
@@ -34,7 +34,7 @@ impl Fr {
pub fn share(self, total: Self, remaining: Abs) -> Abs {
let ratio = self / total;
if ratio.is_finite() && remaining.is_finite() {
- ratio * remaining
+ (ratio * remaining).max(Abs::zero())
} else {
Abs::zero()
}