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