mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 06:32:36 +00:00
Fixed ListOverlay.cpp to respect screen bounds.
This commit is contained in:
parent
4e3a23eef9
commit
2a1431b9c6
@ -143,10 +143,14 @@ void ListOverlay::RecalculateSize() {
|
||||
|
||||
if (this->adapter) {
|
||||
this->height = std::min(
|
||||
(int) MAX_HEIGHT,
|
||||
(int) MAX_HEIGHT,
|
||||
(int) (4 + this->adapter->GetEntryCount()));
|
||||
}
|
||||
|
||||
/* constrain to app bounds */
|
||||
this->height = std::max(0, std::min(Screen::GetHeight() - 4, this->height));
|
||||
this->width = std::max(0, std::min(Screen::GetWidth(), this->width));
|
||||
|
||||
this->y = VERTICAL_PADDING;
|
||||
this->x = (Screen::GetWidth() / 2) - (this->width / 2);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user