From 2167ba68a16fe55c2e3f321f7e51abae76c25cf6 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Mon, 20 Aug 2018 13:34:47 -0700 Subject: [PATCH] Fix panic with empty content in ScrollView --- src/views/scroll_view.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/scroll_view.rs b/src/views/scroll_view.rs index 4d612ea..2f0a8ee 100644 --- a/src/views/scroll_view.rs +++ b/src/views/scroll_view.rs @@ -376,7 +376,7 @@ where fn scrollbar_thumb_lengths(&self) -> Vec2 { let available = self.available_size(); - (available * available / self.inner_size).or_max((1, 1)) + (available * available / self.inner_size.or_max((1,1))).or_max((1, 1)) } fn scrollbar_thumb_offsets(&self, lengths: Vec2) -> Vec2 {