minor fix : elements can't be moved up and left, when there rotation are different than 0.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5389 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2018-06-07 16:29:41 +00:00
parent 6a8523961f
commit 3225bdb371

View File

@@ -310,8 +310,8 @@ void Diagram::keyPressEvent(QKeyEvent *event)
case Qt::Key_Left:
for (Element *item : dc.m_elements)
{
left_position = item->mapRectFromScene(item->boundingRect()).x();
if (left_position >= this->sceneRect().left() - item->boundingRect().width())
left_position = item->sceneBoundingRect().x();
if(left_position <= 5)
return;
}
movement = QPointF(-xGrid, 0.0);
@@ -322,8 +322,8 @@ void Diagram::keyPressEvent(QKeyEvent *event)
case Qt::Key_Up:
for(Element *item : dc.m_elements)
{
top_position = item->mapRectFromScene(item->boundingRect()).y();
if (top_position >= this->sceneRect().top() - item->boundingRect().height())
top_position = item->sceneBoundingRect().y();
if(top_position <= 5)
return;
}
movement = QPointF(0.0, -yGrid);