diff --git a/src/kits/interface/Point.cpp b/src/kits/interface/Point.cpp index 4331fdff6a..75f5b859e3 100644 --- a/src/kits/interface/Point.cpp +++ b/src/kits/interface/Point.cpp @@ -1,11 +1,12 @@ /* - * Copyright 2001-2007, Haiku, Inc. All Rights Reserved. + * Copyright 2001-2014 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Frans van Nispen */ + #include #include @@ -18,10 +19,10 @@ const BPoint B_ORIGIN(0, 0); void -BPoint::ConstrainTo(BRect r) +BPoint::ConstrainTo(BRect rect) { - x = max_c(min_c(x, r.right), r.left); - y = max_c(min_c(y, r.bottom), r.top); + x = max_c(min_c(x, rect.right), rect.left); + y = max_c(min_c(y, rect.bottom), rect.top); } @@ -40,49 +41,48 @@ BPoint::operator-() const BPoint -BPoint::operator+(const BPoint& p) const +BPoint::operator+(const BPoint& other) const { - return BPoint(x + p.x, y + p.y); + return BPoint(x + other.x, y + other.y); } BPoint -BPoint::operator-(const BPoint& p) const +BPoint::operator-(const BPoint& other) const { - return BPoint(x - p.x, y - p.y); + return BPoint(x - other.x, y - other.y); } -BPoint & -BPoint::operator+=(const BPoint& p) +BPoint& +BPoint::operator+=(const BPoint& other) { - x += p.x; - y += p.y; + x += other.x; + y += other.y; return *this; } -BPoint & -BPoint::operator-=(const BPoint& p) +BPoint& +BPoint::operator-=(const BPoint& other) { - x -= p.x; - y -= p.y; + x -= other.x; + y -= other.y; return *this; } bool -BPoint::operator!=(const BPoint& p) const +BPoint::operator!=(const BPoint& other) const { - return x != p.x || y != p.y; + return x != other.x || y != other.y; } bool -BPoint::operator==(const BPoint& p) const +BPoint::operator==(const BPoint& other) const { - return x == p.x && y == p.y; + return x == other.x && y == other.y; } -