diff options
Diffstat (limited to 'indra/newview/llfloatercolorpicker.cpp')
-rw-r--r-- | indra/newview/llfloatercolorpicker.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 69f1774ff8..659e52271a 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -472,6 +472,12 @@ void LLFloaterColorPicker::onMouseCaptureLost() setMouseDownInLumRegion(FALSE); } +F32 LLFloaterColorPicker::getSwatchTransparency() +{ + // If the floater is focused, don't apply its alpha to the color swatch (STORM-676). + return getTransparencyType() == TT_ACTIVE ? 1.f : LLFloater::getCurrentTransparency(); +} + ////////////////////////////////////////////////////////////////////////////// // void LLFloaterColorPicker::draw() @@ -533,8 +539,10 @@ void LLFloaterColorPicker::draw() // base floater stuff LLFloater::draw (); + const F32 alpha = getSwatchTransparency(); + // draw image for RGB area (not really RGB but you'll see what I mean... - gl_draw_image ( mRGBViewerImageLeft, mRGBViewerImageTop - mRGBViewerImageHeight, mRGBImage, LLColor4::white ); + gl_draw_image ( mRGBViewerImageLeft, mRGBViewerImageTop - mRGBViewerImageHeight, mRGBImage, LLColor4::white % alpha); // update 'cursor' into RGB Section S32 xPos = ( S32 ) ( ( F32 )mRGBViewerImageWidth * getCurH () ) - 8; @@ -556,7 +564,7 @@ void LLFloaterColorPicker::draw() mRGBViewerImageTop - mRGBViewerImageHeight, mRGBViewerImageLeft + mRGBViewerImageWidth + 1, mRGBViewerImageTop, - LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), + LLColor4 ( 0.0f, 0.0f, 0.0f, alpha ), FALSE ); // draw luminance slider @@ -569,7 +577,7 @@ void LLFloaterColorPicker::draw() mLumRegionTop - mLumRegionHeight + y, mLumRegionLeft + mLumRegionWidth, mLumRegionTop - mLumRegionHeight + y - 1, - LLColor4 ( rValSlider, gValSlider, bValSlider, 1.0f ) ); + LLColor4 ( rValSlider, gValSlider, bValSlider, alpha ) ); } @@ -594,7 +602,7 @@ void LLFloaterColorPicker::draw() mSwatchRegionTop - mSwatchRegionHeight, mSwatchRegionLeft + mSwatchRegionWidth, mSwatchRegionTop, - LLColor4 ( getCurR (), getCurG (), getCurB (), 1.0f ), + LLColor4 ( getCurR (), getCurG (), getCurB (), alpha ), TRUE ); // draw selected color swatch outline @@ -634,6 +642,7 @@ const LLColor4& LLFloaterColorPicker::getComplimentaryColor ( const LLColor4& ba void LLFloaterColorPicker::drawPalette () { S32 curEntry = 0; + const F32 alpha = getSwatchTransparency(); for ( S32 y = 0; y < numPaletteRows; ++y ) { @@ -648,7 +657,7 @@ void LLFloaterColorPicker::drawPalette () // draw palette entry color if ( mPalette [ curEntry ] ) { - gl_rect_2d ( x1 + 2, y1 - 2, x2 - 2, y2 + 2, *mPalette [ curEntry++ ], TRUE ); + gl_rect_2d ( x1 + 2, y1 - 2, x2 - 2, y2 + 2, *mPalette [ curEntry++ ] % alpha, TRUE ); gl_rect_2d ( x1 + 1, y1 - 1, x2 - 1, y2 + 1, LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), FALSE ); } } |