BPoint: Replace max_c() and min_c() with std::max() and std::min()
This commit is contained in:
parent
e430d19ef6
commit
1867d69c8b
@ -4,11 +4,14 @@
|
|||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Frans van Nispen
|
* Frans van Nispen
|
||||||
|
* John Scipione, jscipione@gmail.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
@ -21,8 +24,8 @@ const BPoint B_ORIGIN(0, 0);
|
|||||||
void
|
void
|
||||||
BPoint::ConstrainTo(BRect rect)
|
BPoint::ConstrainTo(BRect rect)
|
||||||
{
|
{
|
||||||
x = max_c(min_c(x, rect.right), rect.left);
|
x = std::max(std::min(x, rect.right), rect.left);
|
||||||
y = max_c(min_c(y, rect.bottom), rect.top);
|
y = std::max(std::min(y, rect.bottom), rect.top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user