From 73875b3112c17a344e4f1641399c8f782f9208fd Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 19 Oct 2011 20:19:17 +0000 Subject: [PATCH] + fix problem with empty bounding box in sketcher (only occurs with Coin 2.x) git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5042 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index c0566544d..a5fb4f69d 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -2256,8 +2256,10 @@ Restart: SoGetBoundingBoxAction bbAction(viewer->getViewportRegion()); bbAction.apply(sep->getChild(3)); - float bx,by,bz; - bbAction.getBoundingBox().getSize(bx,by,bz); + float bx=0,by=0,bz=0; + SbBox3f bbox = bbAction.getBoundingBox(); + if (!bbox.isEmpty()) + bbox.getSize(bx,by,bz); SbVec3f textBB(bx,by,bz); SbVec3f textBBCenter = bbAction.getBoundingBox().getCenter();