[TD]fix positioning of secondary views
This commit is contained in:
@@ -163,6 +163,7 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
if(change == ItemPositionChange && scene()) {
|
||||
newPos = value.toPointF(); //position within parent!
|
||||
if(m_locked){
|
||||
// ignore position change for locked items
|
||||
newPos.setX(pos().x());
|
||||
newPos.setY(pos().y());
|
||||
return newPos;
|
||||
@@ -170,9 +171,8 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
|
||||
TechDraw::DrawView *viewObj = getViewObject();
|
||||
|
||||
// TODO find a better data structure for this
|
||||
// this is just a pair isn't it?
|
||||
if (viewObj->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) {
|
||||
// restrict movements of secondary views.
|
||||
TechDraw::DrawProjGroupItem* dpgi = static_cast<TechDraw::DrawProjGroupItem*>(viewObj);
|
||||
TechDraw::DrawProjGroup* dpg = dpgi->getPGroup();
|
||||
if (dpg) {
|
||||
@@ -186,11 +186,11 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Gui::ViewProvider *vp = getViewProvider(viewObj);
|
||||
if (vp && !vp->isRestoring()) {
|
||||
viewObj->setPosition(Rez::appX(newPos.x()), Rez::appX(-newPos.y()));
|
||||
}
|
||||
}
|
||||
// tell the feature that we have moved
|
||||
Gui::ViewProvider *vp = getViewProvider(viewObj);
|
||||
if (vp && !vp->isRestoring()) {
|
||||
viewObj->setPosition(Rez::appX(newPos.x()), Rez::appX(-newPos.y()));
|
||||
}
|
||||
|
||||
return newPos;
|
||||
|
||||
Reference in New Issue
Block a user