mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
element editor: minor improvement about line creation
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3455 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -63,7 +63,6 @@ bool ESEventAddLine::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
//Add new line to scene
|
||||
m_line -> setLine(QLineF(m_line->line().p1(), pos));
|
||||
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("ligne"), m_scene, m_line));
|
||||
|
||||
//Set m_line to nullptr for create new line at next mouse press
|
||||
@@ -82,11 +81,9 @@ bool ESEventAddLine::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
*/
|
||||
bool ESEventAddLine::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
updateHelpCross (event -> scenePos());
|
||||
|
||||
if (!m_line) return false;
|
||||
|
||||
QPointF pos = m_scene -> snapToGrid(event -> scenePos());
|
||||
m_line -> setLine(QLineF(m_line->line().p1(), pos));
|
||||
m_line -> setP2(m_scene -> snapToGrid(event -> scenePos()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user