DRTVWR-510: Fix coord error in 'Show Color Under Cursor'

meow-7.2.2
Dave Houlton 2020-05-20 14:43:27 -06:00 committed by Ansariel
parent bf822b85de
commit cb89ee90f5
1 changed files with 17 additions and 13 deletions

View File

@ -781,19 +781,23 @@ public:
addText(xpos, ypos, "View Matrix");
ypos += y_inc;
}
//<FS:AO improve use of controls with radiogroups>
//if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport)
//static LLCachedControl<bool> debugShowColor(gSavedSettings, "DebugShowColor");
static LLCachedControl<S32> debugShowColor(gSavedSettings, "DebugShowColor");
//</FS:AO>
if (debugShowColor && !LLRender::sNsightDebugSupport)
{
U8 color[4];
LLCoordGL coord = gViewerWindow->getCurrentMouse();
glReadPixels(coord.mX, coord.mY, 1,1,GL_RGBA, GL_UNSIGNED_BYTE, color);
addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3]));
ypos += y_inc;
}
//<FS:AO improve use of controls with radiogroups>
//static LLCachedControl<bool> debugShowColor(gSavedSettings, "DebugShowColor");
static LLCachedControl<S32> debugShowColor(gSavedSettings, "DebugShowColor");
if (debugShowColor && !LLRender::sNsightDebugSupport)
//</FS:AO>
{
U8 color[4];
LLCoordGL coord = gViewerWindow->getCurrentMouse();
// Convert x,y to raw pixel coords
S32 x_raw = llround(coord.mX * gViewerWindow->getWindowWidthRaw() / (F32) gViewerWindow->getWindowWidthScaled());
S32 y_raw = llround(coord.mY * gViewerWindow->getWindowHeightRaw() / (F32) gViewerWindow->getWindowHeightScaled());
glReadPixels(x_raw, y_raw, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, color);
addText(xpos, ypos, llformat("Pixel <%1d, %1d> R:%1d G:%1d B:%1d A:%1d", x_raw, y_raw, color[0], color[1], color[2], color[3]));
ypos += y_inc;
}
// <FS:PP> FIRE-29880: Movelock
static LLCachedControl<bool> fsRenderMovelockState(gSavedPerAccountSettings, "UseMoveLock");