Merge pull request #1019 from SMJSGaming/main

Changed the operator overloads of CCPoint to be more inline with othe…
This commit is contained in:
HJfod 2024-07-28 17:30:35 +03:00 committed by GitHub
commit 1185672bb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -149,16 +149,16 @@ namespace cocos2d {
return s1.width != s2.width || s1.height != s2.height;
}
static bool operator<(cocos2d::CCSize const& s1, cocos2d::CCSize const& s2) {
return s1.width < s2.width || s1.height < s2.height;
return s1.width < s2.width && s1.height < s2.height;
}
static bool operator<=(cocos2d::CCSize const& s1, cocos2d::CCSize const& s2) {
return s1.width <= s2.width || s1.height <= s2.height;
return s1.width <= s2.width && s1.height <= s2.height;
}
static bool operator>(cocos2d::CCSize const& s1, cocos2d::CCSize const& s2) {
return s1.width > s2.width || s1.height > s2.height;
return s1.width > s2.width && s1.height > s2.height;
}
static bool operator>=(cocos2d::CCSize const& s1, cocos2d::CCSize const& s2) {
return s1.width >= s2.width || s1.height >= s2.height;
return s1.width >= s2.width && s1.height >= s2.height;
}
static bool operator==(cocos2d::CCRect const& r1, cocos2d::CCRect const& r2) {
return r1.origin == r2.origin && r1.size == r2.size;