From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/gui/widgets/listbox.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gui/widgets/listbox.cpp') diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index c827911eb..ced9dcb99 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -122,7 +122,7 @@ ListBox::ListBox(const Widget2 *const widget, } const Font *const font = getFont(); - mRowHeight = static_cast( + mRowHeight = CAST_U32( font->getHeight() + 2 * mItemPadding); } @@ -157,10 +157,10 @@ void ListBox::draw(Graphics *graphics) BLOCK_START("ListBox::draw") updateAlpha(); - mHighlightColor.a = static_cast(mAlpha * 255.0F); + mHighlightColor.a = CAST_U32(mAlpha * 255.0F); graphics->setColor(mHighlightColor); Font *const font = getFont(); - const int rowHeight = static_cast(getRowHeight()); + const int rowHeight = CAST_S32(getRowHeight()); const int width = mDimension.width; if (mCenterText) @@ -359,7 +359,7 @@ void ListBox::adjustSize() BLOCK_START("ListBox::adjustSize") if (mListModel) { - setHeight(static_cast(getRowHeight()) * + setHeight(CAST_S32(getRowHeight()) * mListModel->getNumberOfElements() + 2 * mPadding); } BLOCK_END("ListBox::adjustSize") @@ -376,7 +376,7 @@ int ListBox::getSelectionByMouse(const int y) const { if (y < mPadding) return -1; - return (y - mPadding) / static_cast(getRowHeight()); + return (y - mPadding) / CAST_S32(getRowHeight()); } void ListBox::setSelected(const int selected) @@ -400,9 +400,9 @@ void ListBox::setSelected(const int selected) if (mSelected < 0) scroll.y = 0; else - scroll.y = static_cast(getRowHeight()) * mSelected; + scroll.y = CAST_S32(getRowHeight()) * mSelected; - scroll.height = static_cast(getRowHeight()); + scroll.height = CAST_S32(getRowHeight()); showPart(scroll); distributeValueChangedEvent(); -- cgit v1.2.3-60-g2f50