Handle no users able to be displayed, insufficient screen height

This commit is contained in:
David Rowe 2015-03-25 19:13:33 -07:00
parent ba1a7c6761
commit 98c88aab04

View file

@ -89,11 +89,11 @@ var usersWindow = (function () {
if (isMirrorDisplay && !isFullscreenMirror) { if (isMirrorDisplay && !isFullscreenMirror) {
maxWindowHeight -= MIRROR_HEIGHT; maxWindowHeight -= MIRROR_HEIGHT;
} }
windowHeight = Math.min(windowHeight, maxWindowHeight); windowHeight = Math.max(Math.min(windowHeight, maxWindowHeight), nonUsersHeight);
// Corresponding number of users to actually display // Corresponding number of users to actually display
numUsersToDisplay = Math.round((windowHeight - nonUsersHeight) / windowLineHeight); numUsersToDisplay = Math.max(Math.round((windowHeight - nonUsersHeight) / windowLineHeight), 0);
isUsingScrollbars = numUsersToDisplay < linesOfUsers.length; isUsingScrollbars = 0 < numUsersToDisplay && numUsersToDisplay < linesOfUsers.length;
} }
function updateOverlayPositions() { function updateOverlayPositions() {