TechDraw: Snap: disable snap if ALT is pressed.
This commit is contained in:
committed by
Chris Hennes
parent
87154d75a8
commit
e49f74aed9
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QApplication>
|
||||
# include <QGraphicsSceneHoverEvent>
|
||||
# include <QGraphicsSceneMouseEvent>
|
||||
# include <QPainter>
|
||||
@@ -178,7 +179,9 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
}
|
||||
else {
|
||||
// For general views we check if we need to snap to a position
|
||||
snapPosition(newPos);
|
||||
if (!(QApplication::keyboardModifiers() & Qt::AltModifier)) {
|
||||
snapPosition(newPos);
|
||||
}
|
||||
}
|
||||
|
||||
// tell the feature that we have moved
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#ifndef _PreComp_
|
||||
# include <cmath>
|
||||
|
||||
# include <QApplication>
|
||||
# include <QGraphicsScene>
|
||||
# include <QGraphicsSceneMouseEvent>
|
||||
# include <QPaintDevice>
|
||||
@@ -132,8 +133,10 @@ QVariant QGIDatumLabel::itemChange(GraphicsItemChange change, const QVariant& va
|
||||
}
|
||||
}
|
||||
else if (change == ItemPositionHasChanged && scene()) {
|
||||
QPointF newPos = value.toPointF(); //position within parent!
|
||||
snapPosition(newPos);
|
||||
if (!(QApplication::keyboardModifiers() & Qt::AltModifier)) {
|
||||
QPointF newPos = value.toPointF(); //position within parent!
|
||||
snapPosition(newPos);
|
||||
}
|
||||
|
||||
setLabelCenter();
|
||||
m_dragState = Dragging;
|
||||
|
||||
Reference in New Issue
Block a user