Permalink
Browse files

SYSclamp32 should not clamp to 0.

  • Loading branch information...
1 parent 3d7750e commit 9bf423d6176a1f66ac19b5d2c4b7ee440bd3fd74 @ajclinto committed Mar 28, 2013
Showing with 4 additions and 2 deletions.
  1. +3 −1 Math.h
  2. +1 −1 Window.C
View
4 Math.h
@@ -54,7 +54,9 @@ inline T SYSclamp(T v, T a, T b)
}
inline int SYSclamp32(int64 val)
{
- return (int)SYSclamp(val, 0ll, (int64)std::numeric_limits<int>::max());
+ return (int)SYSclamp(val,
+ (int64)std::numeric_limits<int>::min(),
+ (int64)std::numeric_limits<int>::max());
}
template <typename T>
inline T SYSlerp(T v1, T v2, T bias)
View
@@ -441,7 +441,7 @@ setScrollMax(QScrollBar *scroll, int64 size, bool with_margin = true)
int64 nmax = SYSmax(size - scroll->pageStep() + margin, 0ll);
scroll->setMaximum(SYSclamp32(nmax));
- scroll->setMinimum(-SYSclamp32(margin));
+ scroll->setMinimum(SYSclamp32(-margin));
}
void

0 comments on commit 9bf423d

Please sign in to comment.