mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 22:30:30 +01:00
Use std::min and std::max
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include <escher/warning_controller.h>
|
||||
#include <escher/container.h>
|
||||
|
||||
static inline KDCoordinate maxCoordinate(KDCoordinate x, KDCoordinate y) { return x > y ? x : y; }
|
||||
#include <algorithm>
|
||||
|
||||
WarningController::ContentView::ContentView() :
|
||||
SolidColorView(KDColorBlack),
|
||||
@@ -46,7 +45,7 @@ KDSize WarningController::ContentView::minimalSizeForOptimalDisplay() const {
|
||||
}
|
||||
assert(numberOfSubviews() == 2);
|
||||
KDSize textSize2 = m_textView2.minimalSizeForOptimalDisplay();
|
||||
return KDSize(maxCoordinate(textSize1.width(), textSize2.width()) + k_horizontalMargin,
|
||||
return KDSize(std::max(textSize1.width(), textSize2.width()) + k_horizontalMargin,
|
||||
textSize1.height() + textSize2.height() + 2*k_topAndBottomMargin + k_middleMargin);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user