diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-11-25 20:20:11 +0200 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-11-25 20:20:11 +0200 |
commit | 6a3efddaf6e1254c25c2640d9abc055ca661f24d (patch) | |
tree | 0fec4314ae05c31c8ab6cc1f36068e6187793d58 /indra/newview | |
parent | e997a09343ad2a1f082b63c3bce83f9cd9566637 (diff) |
STORM-676 FIXED Made color swatch control transparent if the floater it resides in is transparent.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llcolorswatch.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index e7634ff0f4..2bb54d3fe6 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -195,7 +195,7 @@ BOOL LLColorSwatchCtrl::handleMouseUp(S32 x, S32 y, MASK mask) // assumes GL state is set for 2D void LLColorSwatchCtrl::draw() { - F32 alpha = getDrawContext().mAlpha; + F32 alpha = getCurrentTransparency(); mBorder->setKeyboardFocusHighlight(hasFocus()); // Draw border LLRect border( 0, getRect().getHeight(), getRect().getWidth(), mLabelHeight ); @@ -207,19 +207,29 @@ void LLColorSwatchCtrl::draw() // Check state if ( mValid ) { + if (!mColor.isOpaque()) + { + // Draw checker board. + gl_rect_2d_checkerboard(interior, alpha); + } + // Draw the color swatch - gl_rect_2d_checkerboard( interior ); - gl_rect_2d(interior, mColor, TRUE); - LLColor4 opaque_color = mColor; - opaque_color.mV[VALPHA] = 1.f; - gGL.color4fv(opaque_color.mV); - if (mAlphaGradientImage.notNull()) + gl_rect_2d(interior, mColor % alpha, TRUE); + + if (!mColor.isOpaque()) { - gGL.pushMatrix(); + // Draw semi-transparent center area in filled with mColor. + LLColor4 opaque_color = mColor; + opaque_color.mV[VALPHA] = alpha; + gGL.color4fv(opaque_color.mV); + if (mAlphaGradientImage.notNull()) { - mAlphaGradientImage->draw(interior, mColor); + gGL.pushMatrix(); + { + mAlphaGradientImage->draw(interior, mColor % alpha); + } + gGL.popMatrix(); } - gGL.popMatrix(); } } else |