Commit b9f0212c authored by Fabio Bas's avatar Fabio Bas
Browse files

Clamp the zoneviewwidget's topleft point to the scene view area; fix #754

parent 06e53275
......@@ -185,6 +185,24 @@ void ZoneViewWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
void ZoneViewWidget::moveWidget(QPointF scenePos)
{
if(scenePos.x() < 0)
{
scenePos.setX(0);
} else {
qreal maxw = scene()->sceneRect().width() - 100;
if(scenePos.x() > maxw)
scenePos.setX(maxw);
}
if(scenePos.y() < 0)
{
scenePos.setY(0);
} else {
qreal maxh = scene()->sceneRect().height() - 100;
if(scenePos.y() > maxh)
scenePos.setY(maxh);
}
setPos(scenePos);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment