make SelectView less greedy

This commit is contained in:
Nils Berg 2018-03-01 21:13:15 +01:00
parent 5094f49219
commit 8bf82a9b58

View File

@ -677,7 +677,9 @@ impl<T: 'static> View for SelectView<T> {
// Add 2 spaces for the scrollbar if we need // Add 2 spaces for the scrollbar if we need
let w = if scrolling { w + 2 } else { w }; let w = if scrolling { w + 2 } else { w };
Vec2::new(w, h) // Don't request more than we're offered - we can scroll,
// after all
Vec2::new(w, min(h, req.y))
} }
} }