Allow View Position to be Locked
- prevents accidently moving View A from desired position while grabbing/dragging View B.
This commit is contained in:
committed by
Yorik van Havre
parent
b6296395e2
commit
1e7aa621f1
@@ -76,6 +76,7 @@ DrawView::DrawView(void)
|
||||
|
||||
ADD_PROPERTY_TYPE(X ,(0),group,App::Prop_None,"X position of the view on the page in modelling units (mm)");
|
||||
ADD_PROPERTY_TYPE(Y ,(0),group,App::Prop_None,"Y position of the view on the page in modelling units (mm)");
|
||||
ADD_PROPERTY_TYPE(LockPosition ,(false),group,App::Prop_None,"Prevent View from moving in Gui");
|
||||
ADD_PROPERTY_TYPE(Rotation ,(0),group,App::Prop_None,"Rotation of the view on the page in degrees counterclockwise");
|
||||
|
||||
ScaleType.setEnums(ScaleTypeEnums);
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
|
||||
App::PropertyFloat X;
|
||||
App::PropertyFloat Y;
|
||||
App::PropertyBool LockPosition;
|
||||
App::PropertyFloatConstraint Scale;
|
||||
|
||||
App::PropertyEnumeration ScaleType;
|
||||
|
||||
@@ -257,6 +257,11 @@ double QGIView::getYInClip(double y)
|
||||
|
||||
void QGIView::updateView(bool update)
|
||||
{
|
||||
if (getViewObject()->LockPosition.getValue()) {
|
||||
setFlag(QGraphicsItem::ItemIsMovable, false);
|
||||
} else {
|
||||
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||
}
|
||||
if (update ||
|
||||
getViewObject()->X.isTouched() ||
|
||||
getViewObject()->Y.isTouched()) {
|
||||
|
||||
Reference in New Issue
Block a user