| 445 | template<typename T> static inline T ImLerp(T a, T b, float t) { return (T)(a + (b - a) * t); } |
| 446 | template<typename T> static inline void ImSwap(T& a, T& b) { T tmp = a; a = b; b = tmp; } |
| 447 | template<typename T> static inline T ImAddClampOverflow(T a, T b, T mn, T mx) { if (b < 0 && (a < mn - b)) return mn; if (b > 0 && (a > mx - b)) return mx; return a + b; } |
| 448 | template<typename T> static inline T ImSubClampOverflow(T a, T b, T mn, T mx) { if (b > 0 && (a < mn + b)) return mn; if (b < 0 && (a > mx + b)) return mx; return a - b; } |
| 449 | // - Misc maths helpers |
| 450 | static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y); } |