aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
authorFilippos Karapetis2009-03-25 23:14:08 +0000
committerFilippos Karapetis2009-03-25 23:14:08 +0000
commit831d3d542e639cff3d111769009f5032a77da67e (patch)
tree342b8eb731809cab8e1829bff2f5c907701e143a /engines/sci/gfx
parent58a66cb3cd7f3582343ea5771cfc6fecdf87b05a (diff)
downloadscummvm-rg350-831d3d542e639cff3d111769009f5032a77da67e.tar.gz
scummvm-rg350-831d3d542e639cff3d111769009f5032a77da67e.tar.bz2
scummvm-rg350-831d3d542e639cff3d111769009f5032a77da67e.zip
Changed the primitive equality check to not use Common::Rect, as the two primitives being compared might not actually be rectangles (e.g. they may be lines, in which case the "width" and "height" might be negative)
svn-id: r39695
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/gfx_widgets.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp
index 3aacd8f42c..8f25abd3dd 100644
--- a/engines/sci/gfx/gfx_widgets.cpp
+++ b/engines/sci/gfx/gfx_widgets.cpp
@@ -496,7 +496,10 @@ static int _gfxwop_primitive_equals(gfxw_widget_t *widget, gfxw_widget_t *other)
oprim = (gfxw_primitive_t *) other;
- if (!toCommonRect(wprim->bounds).equals(toCommonRect(oprim->bounds)))
+ // Check if the two primitives are equal (note: the primitives aren't always rectangles, so
+ // the "width" and the "height" here could be negative)
+ if (wprim->bounds.x != oprim->bounds.x || wprim->bounds.y != oprim->bounds.y ||
+ wprim->bounds.width != oprim->bounds.width || wprim->bounds.height != oprim->bounds.height)
return 0;
if (!_color_equals(wprim->color, oprim->color))