PartDesign: change view sizing on new sketch
This commit is contained in:
@@ -720,24 +720,6 @@ void CmdPartDesignNewSketch::activated(int iMsg)
|
||||
Base::Console().Error("Failed to create a Body object");
|
||||
return;
|
||||
}
|
||||
|
||||
// The method 'SoCamera::viewBoundingBox' is still declared as protected in Coin3d versions
|
||||
// older than 4.0.
|
||||
#if COIN_MAJOR_VERSION >= 4
|
||||
// if no part feature was there then auto-adjust the camera
|
||||
Gui::Document* guidoc = Gui::Application::Instance->getDocument(doc);
|
||||
Gui::View3DInventor* view = guidoc ? qobject_cast<Gui::View3DInventor*>(guidoc->getActiveView()) : nullptr;
|
||||
if (view) {
|
||||
SoCamera* camera = view->getViewer()->getCamera();
|
||||
SbViewportRegion vpregion = view->getViewer()->getViewportRegion();
|
||||
float aspectratio = vpregion.getViewportAspectRatio();
|
||||
|
||||
float size = Gui::ViewProviderOrigin::defaultSize();
|
||||
SbBox3f bbox;
|
||||
bbox.setBounds(-size,-size,-size,size,size,size);
|
||||
camera->viewBoundingBox(bbox, aspectratio, 1.0f);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// At this point, we have pcActiveBody
|
||||
|
||||
Reference in New Issue
Block a user