mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 22:51:28 +02:00
Scroll when click above or below bar
This commit is contained in:
parent
c7fe7aa157
commit
876f3e8a23
1 changed files with 16 additions and 1 deletions
|
@ -329,7 +329,8 @@ var usersWindow = (function () {
|
||||||
lineClicked,
|
lineClicked,
|
||||||
userClicked,
|
userClicked,
|
||||||
i,
|
i,
|
||||||
visibilityChanged;
|
visibilityChanged,
|
||||||
|
delta;
|
||||||
|
|
||||||
if (!isVisible) {
|
if (!isVisible) {
|
||||||
return;
|
return;
|
||||||
|
@ -380,6 +381,20 @@ var usersWindow = (function () {
|
||||||
scrollbarBarClickedAt = (event.y - scrollbarBarPosition.y) / scrollbarBarHeight;
|
scrollbarBarClickedAt = (event.y - scrollbarBarPosition.y) / scrollbarBarHeight;
|
||||||
isMovingScrollbar = true;
|
isMovingScrollbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clickedOverlay === scrollbarBackground2D) {
|
||||||
|
delta = scrollbarBarHeight / (scrollbarBackgroundHeight - scrollbarBarHeight);
|
||||||
|
|
||||||
|
if (event.y < scrollbarBarPosition.y) {
|
||||||
|
scrollbarValue = Math.max(scrollbarValue - delta, 0.0);
|
||||||
|
} else {
|
||||||
|
scrollbarValue = Math.min(scrollbarValue + delta, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
firstUserToDisplay = Math.floor(scrollbarValue * (linesOfUsers.length - numUsersToDisplay));
|
||||||
|
updateOverlayPositions();
|
||||||
|
updateUsersDisplay();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseMoveEvent(event) {
|
function onMouseMoveEvent(event) {
|
||||||
|
|
Loading…
Reference in a new issue