mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
limit movement to int-values to be able to re-position to original position
This commit is contained in:
@@ -584,7 +584,9 @@ void DynamicElementTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
current_parent_pos = mapToParent(mapFromScene(event->scenePos()));
|
||||
button_down_parent_pos = mapToParent(mapFromScene(event->buttonDownScenePos(Qt::LeftButton)));
|
||||
|
||||
QPointF new_pos = m_initial_position + current_parent_pos - button_down_parent_pos;
|
||||
int diffx = qRound(current_parent_pos.x() - button_down_parent_pos.x());
|
||||
int diffy = qRound(current_parent_pos.y() - button_down_parent_pos.y());
|
||||
QPointF new_pos = m_initial_position + QPointF(diffx, diffy);
|
||||
setPos(new_pos);
|
||||
|
||||
if(diagram())
|
||||
|
||||
Reference in New Issue
Block a user