Fix compilation under MSVC

Use template for std::min and std::max
This commit is contained in:
conde2
2013-11-30 23:08:43 -02:00
parent b61f509755
commit ca2fe9cf45
10 changed files with 28 additions and 28 deletions

View File

@@ -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;
}

View File

@@ -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) {