[TechDraw] Reimplement Rich Annotation parent linking

This commit is contained in:
pavltom
2024-02-15 17:06:21 +01:00
committed by WandererFan
parent 0c09c6257c
commit d11d3cd7b8
18 changed files with 136 additions and 194 deletions

View File

@@ -242,8 +242,9 @@ int DrawPage::addView(App::DocumentObject* docObj)
}
DrawView* view = static_cast<DrawView*>(docObj);
//position all new views in center of Page (exceptDVDimension)
if (!docObj->isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId())
//position all new views without owners in center of Page (exceptDVDimension)
if (!view->claimParent()
&& !docObj->isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId())
&& !docObj->isDerivedFrom(TechDraw::DrawViewBalloon::getClassTypeId())) {
view->X.setValue(getPageWidth() / 2.0);
view->Y.setValue(getPageHeight() / 2.0);