Merge pull request #2838 from talentraspel/19651

Stats area is now always right of mirror display
This commit is contained in:
Brad Hefta-Gaub 2014-05-13 08:37:15 -07:00
commit 629a6d4440

View file

@ -686,11 +686,8 @@ void Application::resizeGL(int width, int height) {
glLoadIdentity();
// update Stats width
int horizontalOffset = 0;
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
// mirror is enabled, let's set horizontal offset to give stats some margin
horizontalOffset += MIRROR_VIEW_WIDTH + MIRROR_VIEW_LEFT_PADDING * 2;
}
// let's set horizontal offset to give stats some margin to mirror
int horizontalOffset = MIRROR_VIEW_WIDTH + MIRROR_VIEW_LEFT_PADDING * 2;
Stats::getInstance()->resetWidth(width, horizontalOffset);
}
@ -1164,10 +1161,8 @@ void Application::mouseReleaseEvent(QMouseEvent* event) {
_mousePressed = false;
checkBandwidthMeterClick();
if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
int horizontalOffset = 0;
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
horizontalOffset = MIRROR_VIEW_WIDTH;
}
// let's set horizontal offset to give stats some margin to mirror
int horizontalOffset = MIRROR_VIEW_WIDTH;
Stats::getInstance()->checkClick(_mouseX, _mouseY, _mouseDragStartedX, _mouseDragStartedY, horizontalOffset);
}
}
@ -2732,11 +2727,8 @@ void Application::displayOverlay() {
glPointSize(1.0f);
if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
int horizontalOffset = 0;
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
// mirror is enabled, let's set horizontal offset to give stats some margin
horizontalOffset += MIRROR_VIEW_WIDTH + MIRROR_VIEW_LEFT_PADDING * 2;
}
// let's set horizontal offset to give stats some margin to mirror
int horizontalOffset = MIRROR_VIEW_WIDTH + MIRROR_VIEW_LEFT_PADDING * 2;
int voxelPacketsToProcess = _voxelProcessor.packetsToProcessCount();
// Onscreen text about position, servers, etc
Stats::getInstance()->display(WHITE_TEXT, horizontalOffset, _fps, _packetsPerSecond, _bytesPerSecond, voxelPacketsToProcess);