diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-08-04 00:15:15 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-08-04 00:15:15 +0300 |
commit | 014d7616b65fba699690589426a74e8acfc1a16c (patch) | |
tree | d17ffdfb93d4194cfe51cd5c2a603850f9d45de2 /indra/llui/llprogressbar.cpp | |
parent | 1f53aab286a89dc246a8bdc5a4db3ee524d4412c (diff) | |
parent | 9dba9f80f4d40ec12a735ddbb66a9d103a959ece (diff) |
Merge branch master (DRTVWR-561) into DRTVWR-483
Diffstat (limited to 'indra/llui/llprogressbar.cpp')
-rw-r--r-- | indra/llui/llprogressbar.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp index 209796565c..cf57b1fe76 100644 --- a/indra/llui/llprogressbar.cpp +++ b/indra/llui/llprogressbar.cpp @@ -69,16 +69,22 @@ void LLProgressBar::draw() static LLTimer timer; F32 alpha = getDrawContext().mAlpha; - LLColor4 image_bar_color = mColorBackground.get(); - image_bar_color.setAlpha(alpha); - mImageBar->draw(getLocalRect(), image_bar_color); + if (mImageBar) // optional according to parameters + { + LLColor4 image_bar_color = mColorBackground.get(); + image_bar_color.setAlpha(alpha); + mImageBar->draw(getLocalRect(), image_bar_color); + } - alpha *= 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32())); - LLColor4 bar_color = mColorBar.get(); - bar_color.mV[VALPHA] *= alpha; // modulate alpha - LLRect progress_rect = getLocalRect(); - progress_rect.mRight = ll_round(getRect().getWidth() * (mPercentDone / 100.f)); - mImageFill->draw(progress_rect, bar_color); + if (mImageFill) + { + alpha *= 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32())); + LLColor4 bar_color = mColorBar.get(); + bar_color.mV[VALPHA] *= alpha; // modulate alpha + LLRect progress_rect = getLocalRect(); + progress_rect.mRight = ll_round(getRect().getWidth() * (mPercentDone / 100.f)); + mImageFill->draw(progress_rect, bar_color); + } } void LLProgressBar::setValue(const LLSD& value) |