Main Page   Class Hierarchy   Compound List   File List   Compound Members  

mgobject.cc

00001 #include "magic/mgobject.h"
00002 
00003 decl_module (gobject);
00004 
00005 void Rect::operator= (const Rect& other) {
00006     memcpy (this, &other, sizeof(Rect));
00007 }
00008 
00009 void Rect::moveTo (const Coord2D& pos) {
00010     Coord2D offset (pos.x-mCorner1.x, pos.y-mCorner1.y);
00011     moveBy (offset);
00012 }
00013 
00014 void Rect::moveBy (const Coord2D& offset) {
00015     mCorner1 += offset;
00016     mCorner2 += offset;
00017 }
00018 
00019 bool Rect::touches (const Rect& other) const {
00020     /*
00021     if (is_inside (other.x0, other.y0)) return 1;
00022     if (is_inside (other.x0, other.y1)) return 1;
00023     if (is_inside (other.x1, other.y1)) return 1;
00024     if (is_inside (other.x1, other.y0)) return 1;
00025     if (other.is_inside (x0, y0))   return 1;
00026     if (other.is_inside (x0, y1))   return 1;
00027     if (other.is_inside (x1, y1))   return 1;
00028     if (other.is_inside (x1, y0))   return 1;
00029     */
00030     return false;
00031 }

Generated at Tue Dec 4 19:53:25 2001 for MagiC++ by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001