mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 22:43:27 +02:00
Fix compilation under MSVC
Use template for std::min and std::max
This commit is contained in:
@@ -221,10 +221,10 @@ public:
|
||||
|
||||
TRect<T> united(const TRect<T> &r) const {
|
||||
TRect<T> tmp;
|
||||
tmp.x1 = std::min(x1, r.x1);
|
||||
tmp.x2 = std::max(x2, r.x2);
|
||||
tmp.y1 = std::min(y1, r.y1);
|
||||
tmp.y2 = std::max(y2, r.y2);
|
||||
tmp.x1 = std::min<T>(x1, r.x1);
|
||||
tmp.x2 = std::max<T>(x2, r.x2);
|
||||
tmp.y1 = std::min<T>(y1, r.y1);
|
||||
tmp.y2 = std::max<T>(y2, r.y2);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@@ -263,10 +263,10 @@ public:
|
||||
b2 = r.y2;
|
||||
|
||||
TRect<T> tmp;
|
||||
tmp.x1 = std::max(l1, l2);
|
||||
tmp.x2 = std::min(r1, r2);
|
||||
tmp.y1 = std::max(t1, t2);
|
||||
tmp.y2 = std::min(b1, b2);
|
||||
tmp.x1 = std::max<int>(l1, l2);
|
||||
tmp.x2 = std::min<int>(r1, r2);
|
||||
tmp.y1 = std::max<int>(t1, t2);
|
||||
tmp.y2 = std::min<int>(b1, b2);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
@@ -70,8 +70,8 @@ public:
|
||||
bool operator==(const TSize<T>& other) const { return other.wd==wd && other.ht==ht; }
|
||||
bool operator!=(const TSize<T>& other) const { return other.wd!=wd || other.ht!=ht; }
|
||||
|
||||
TSize<T> expandedTo(const TSize<T>& other) const { return TSize<T>(std::max(wd,other.wd), std::max(ht,other.ht)); }
|
||||
TSize<T> boundedTo(const TSize<T>& other) const { return TSize<T>(std::min(wd,other.wd), std::min(ht,other.ht)); }
|
||||
TSize<T> expandedTo(const TSize<T>& other) const { return TSize<T>(std::max<T>(wd, other.wd), std::max<T>(ht, other.ht)); }
|
||||
TSize<T> boundedTo(const TSize<T>& other) const { return TSize<T>(std::min<T>(wd, other.wd), std::min<T>(ht, other.ht)); }
|
||||
|
||||
void scale(const TSize<T>& s, Fw::AspectRatioMode mode) {
|
||||
if(mode == Fw::IgnoreAspectRatio || wd == 0 || ht == 0) {
|
||||
|
Reference in New Issue
Block a user