Band movement has been fixed

This commit is contained in:
Arin Alexander 2019-03-01 19:48:49 +03:00
parent 8854f59916
commit 495cf4e35e
2 changed files with 3 additions and 1 deletions

View File

@ -105,6 +105,7 @@ void BandMarker::mousePressEvent(QGraphicsSceneMouseEvent *event)
if (!(event->modifiers() & Qt::ControlModifier))
m_band->scene()->clearSelection();
m_band->setSelected(true);
m_oldBandPos = m_band->pos();
update(0,0,boundingRect().width(),boundingRect().width());
}
}
@ -136,7 +137,7 @@ void BandMarker::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
void BandMarker::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
{
m_band->posChanged(m_band, m_band->pos(), m_band->pos());
m_band->posChanged(m_band, m_band->pos(), m_oldBandPos);
}
BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, QObject* owner, QGraphicsItem *parent) :

View File

@ -72,6 +72,7 @@ private:
QRectF m_rect;
QColor m_color;
BandDesignIntf* m_band;
QPointF m_oldBandPos;
};
class BandNameLabel : public QGraphicsItem{