Merge pull request #212 from T045T/friendly_select_view

make SelectView less greedy
This commit is contained in:
Alexandre Bury 2018-03-01 13:35:11 -08:00 committed by GitHub
commit feeedfd4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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))
} }
} }