aboutsummaryrefslogtreecommitdiff
path: root/engines/composer
diff options
context:
space:
mode:
authorAlyssa Milburn2011-07-18 17:03:55 +0200
committerAlyssa Milburn2011-07-18 17:03:55 +0200
commit8bf558a299096f385630b7ee148dd509005e983b (patch)
tree0734786cceaeff4a4ff441757b84680d97492bf1 /engines/composer
parent968db67b405328b6cfe36ad7c9765ecf5492bc27 (diff)
downloadscummvm-rg350-8bf558a299096f385630b7ee148dd509005e983b.tar.gz
scummvm-rg350-8bf558a299096f385630b7ee148dd509005e983b.tar.bz2
scummvm-rg350-8bf558a299096f385630b7ee148dd509005e983b.zip
COMPOSER: Try to fix contains() for kButtonEllipse.
Diffstat (limited to 'engines/composer')
-rw-r--r--engines/composer/composer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 78819a92c5..74696e81b1 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -312,12 +312,12 @@ bool Button::contains(const Common::Point &pos) const {
if (!_rect.contains(pos))
return false;
{
- int16 a = _rect.height() / 2;
- int16 b = _rect.width() / 2;
+ int16 a = _rect.width() / 2;
+ int16 b = _rect.height() / 2;
if (!a || !b)
return false;
Common::Point adjustedPos = pos - Common::Point(_rect.left + a, _rect.top + b);
- return ((adjustedPos.x*adjustedPos.x)/a*2 + (adjustedPos.y*adjustedPos.y)/b*2 < 1);
+ return ((adjustedPos.x*adjustedPos.x)/(a*a) + (adjustedPos.y*adjustedPos.y)/(b*b) < 1);
}
case kButtonSprites:
return false;