diff options
Diffstat (limited to 'src/gui/widgets/dropdown.cpp')
-rw-r--r-- | src/gui/widgets/dropdown.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 1d09d5c97..f4fb56f9e 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -226,7 +226,6 @@ void DropDown::draw(Graphics *const graphics) updateAlpha(); const unsigned int alpha = CAST_U32(mAlpha * 255.0F); - const int pad = 2 * mPadding; mHighlightColor.a = alpha; mShadowColor.a = alpha; @@ -272,6 +271,7 @@ void DropDown::draw(Graphics *const graphics) if (isFocused()) { + const int pad = 2 * mPadding; graphics->setColor(mHighlightColor); graphics->drawRectangle(Rect(mPadding, mPadding, mDimension.width - h - pad, h - pad)); @@ -321,11 +321,10 @@ void DropDown::safeDrawFrame(Graphics *const graphics) void DropDown::drawButton(Graphics *const graphics) { - const int height = mDroppedDown ? mFoldedUpHeight : mDimension.height; - - Image *image = buttons[mDroppedDown][mPushed]; + Image *const image = buttons[mDroppedDown][mPushed]; if (image != nullptr) { + const int height = mDroppedDown ? mFoldedUpHeight : mDimension.height; graphics->drawImage(image, mDimension.width - image->getWidth() - mImagePadding, (height - image->getHeight()) / 2); |