mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-15 11:48:33 +00:00
Crash bug fix for empty scrollviews
This commit is contained in:
parent
feb521fd41
commit
397da81a2e
@ -646,6 +646,7 @@ void ScrollView::Draw(UIContext &dc) {
|
||||
ViewGroup::Draw(dc);
|
||||
return;
|
||||
}
|
||||
|
||||
dc.PushScissor(bounds_);
|
||||
views_[0]->Draw(dc);
|
||||
dc.PopScissor();
|
||||
@ -707,8 +708,10 @@ void ScrollView::ScrollRelative(float distance) {
|
||||
}
|
||||
|
||||
void ScrollView::ClampScrollPos(float &pos) {
|
||||
if (!views_.size())
|
||||
if (!views_.size()) {
|
||||
pos = 0.0f;
|
||||
return;
|
||||
}
|
||||
// Clamp scrollTarget.
|
||||
float childHeight = views_[0]->GetBounds().h;
|
||||
float scrollMax = std::max(0.0f, childHeight - bounds_.h);
|
||||
|
Loading…
x
Reference in New Issue
Block a user