diff -r 325958acb69b -r 8e3d07807ac5 mapobj.cpp --- a/mapobj.cpp Mon Oct 10 11:20:25 2005 +0000 +++ b/mapobj.cpp Tue Jan 03 09:44:41 2006 +0000 @@ -82,17 +82,22 @@ absPos.setX( xi); absPos.setY( yi); bbox.moveTopLeft(QPoint(xi,yi)); + clickBox.moveTopLeft(QPoint(xi,yi)); } void MapObj::moveBy (double x, double y) { + int ix=(int)x; + int iy=(int)y; move (x+absPos.x(),y+absPos.y() ); + bbox.moveBy (ix,iy); + clickBox.moveBy (ix,iy); } -bool MapObj::inBBox(QPoint p) +bool MapObj::inBox(const QPoint &p) { - if (p.x() >= bbox.left() && p.x() <= bbox.right() - && p.y() <= bbox.bottom() && p.y() >= bbox.top() ) + if (p.x() >= clickBox.left() && p.x() <= clickBox.right() + && p.y() <= clickBox.bottom() && p.y() >= clickBox.top() ) return true; return false; } @@ -103,7 +108,9 @@ } QRect MapObj::addBBox(QRect r1, QRect r2) -{ +{ + // Find smallest QRect containing given rectangles + QRect n; // Set left border if (r1.left() <= r2.left() )