Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Fixed height and width limit
Browse files Browse the repository at this point in the history
  • Loading branch information
MPIBR-kretschmerf committed Apr 25, 2017
1 parent 1125499 commit 4bd5c7f
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions TrackerPlugin_EyeTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,28 @@ void TrackerPlugin_EyeTracker::onItemChanged(QGraphicsItem *item)
if(rect.x() < 0){
rect.setRight(rect.right() - rect.x());
rect.setLeft(0);
rectItems.at(rectIdx)->setRect(rect); }
}else if (rect.right() >= cameraResolution.width()){
rect.setLeft(rect.left() + (cameraResolution.width() - rect.right()));
rect.setRight(cameraResolution.width());
}
if(rect.y() < 0){
rect.setBottom(rect.bottom() - rect.y());
rect.setTop(0);
rectItems.at(rectIdx)->setRect(rect);
}else if (rect.bottom() >= cameraResolution.height()){
rect.setTop(rect.top() + (cameraResolution.height() - rect.bottom()));
rect.setBottom(cameraResolution.height());
}
if (rect.right() >= cameraResolution.width()){
rect.setLeft(rect.left() + (cameraResolution.width() - rect.right()));
if(rect.width()> cameraResolution.width()){
rect.setLeft(0);
rect.setRight(cameraResolution.width());
rectItems.at(rectIdx)->setRect(rect);
}
if (rect.bottom() >= cameraResolution.height()){
rect.setTop(rect.top() + (cameraResolution.height() - rect.bottom()));
if(rect.height()>cameraResolution.height()){
rect.setTop(0);
rect.setBottom(cameraResolution.height());
rectItems.at(rectIdx)->setRect(rect);
}

rectItems.at(rectIdx)->setRect(rect);

emit(roiChanged(rectIdx, rect.toRect()));
}
}
Expand Down

0 comments on commit 4bd5c7f

Please sign in to comment.