NodeSet::iterator i=scanline.find(v);
while(i!=scanline.begin()) {
Node *u=*(--i);
- if(u->r->overlapX(v->r)<=0) {
+ if(u->r->overlapX(*v->r)<=0) {
leftv.insert(u);
return leftv;
}
- if(u->r->overlapX(v->r)<=u->r->overlapY(v->r)) {
+ if(u->r->overlapX(*v->r)<=u->r->overlapY(*v->r)) {
leftv.insert(u);
}
}
NodeSet::iterator i=scanline.find(v);
for(i++;i!=scanline.end(); i++) {
Node *u=*(i);
- if(u->r->overlapX(v->r)<=0) {
+ if(u->r->overlapX(*v->r)<=0) {
rightv.insert(u);
return rightv;
}
- if(u->r->overlapX(v->r)<=u->r->overlapY(v->r)) {
+ if(u->r->overlapX(*v->r)<=u->r->overlapY(*v->r)) {
rightv.insert(u);
}
}
maxY=y+height()-yBorder;
minY=y;
}
- inline double overlapX(Rectangle *r) const {
- if (getCentreX() <= r->getCentreX() && r->minX < getMaxX())
- return getMaxX() - r->minX;
- if (r->getCentreX() <= getCentreX() && minX < r->getMaxX())
- return r->getMaxX() - minX;
+ inline double overlapX(const Rectangle &r) const {
+ if (getCentreX() <= r.getCentreX() && r.minX < getMaxX())
+ return getMaxX() - r.minX;
+ if (r.getCentreX() <= getCentreX() && minX < r.getMaxX())
+ return r.getMaxX() - minX;
return 0;
}
- inline double overlapY(Rectangle *r) const {
- if (getCentreY() <= r->getCentreY() && r->minY < getMaxY())
- return getMaxY() - r->minY;
- if (r->getCentreY() <= getCentreY() && minY < r->getMaxY())
- return r->getMaxY() - minY;
+ inline double overlapY(const Rectangle &r) const {
+ if (getCentreY() <= r.getCentreY() && r.minY < getMaxY())
+ return getMaxY() - r.minY;
+ if (r.getCentreY() <= getCentreY() && minY < r.getMaxY())
+ return r.getMaxY() - minY;
return 0;
}
private: