Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions cocos/math/CCGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,10 @@ float Rect::getMinY() const

bool Rect::containsPoint(const Vec2& point) const
{
bool bRet = false;

if (point.x >= getMinX() && point.x <= getMaxX()
&& point.y >= getMinY() && point.y <= getMaxY())
{
bRet = true;
}

return bRet;
return (point.x >= getMinX() &&
point.x <= getMaxX() &&
point.y >= getMinY() &&
point.y <= getMaxY());
}

bool Rect::intersectsRect(const Rect& rect) const
Expand Down
2 changes: 1 addition & 1 deletion cocos/math/CCGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class CC_DLL Rect
*/
bool equals(const Rect& rect) const;
/**
Check if the points is contained in the rect.
Check if the points is contained inclusively in the rect.
* @js NA
*/
bool containsPoint(const Vec2& point) const;
Expand Down