From 883817f407586ed22831094a2c701ad8a110a095 Mon Sep 17 00:00:00 2001
From: Ansgar Philippsen <ansgar.philippsen@gmail.com>
Date: Wed, 13 Jul 2011 10:44:34 -0400
Subject: [PATCH] another fix for primlist autoslab

---
 modules/gfx/src/prim_list.cc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/gfx/src/prim_list.cc b/modules/gfx/src/prim_list.cc
index 888246f96..c541490c1 100644
--- a/modules/gfx/src/prim_list.cc
+++ b/modules/gfx/src/prim_list.cc
@@ -84,16 +84,16 @@ void PrimList::ProcessLimits(geom::Vec3& minc, geom::Vec3& maxc,
   }
   for(PointEntryList::const_iterator it=spheres_.begin();it!=spheres_.end();++it) {
     geom::Vec3 tpos = tf.Apply(it->pos);
-    minc=geom::Min(minc,tpos);
-    maxc=geom::Max(maxc,tpos);
+    minc=geom::Min(minc,tpos-it->rad);
+    maxc=geom::Max(maxc,tpos+it->rad);
   }
   for(LineEntryList::const_iterator it=cyls_.begin();it!=cyls_.end();++it) {
     geom::Vec3 tpos = tf.Apply(it->pos1);
-    minc=geom::Min(minc,tpos);
-    maxc=geom::Max(maxc,tpos);
+    minc=geom::Min(minc,tpos-it->rad1);
+    maxc=geom::Max(maxc,tpos+it->rad1);
     tpos = tf.Apply(it->pos2);
-    minc=geom::Min(minc,tpos);
-    maxc=geom::Max(maxc,tpos);
+    minc=geom::Min(minc,tpos-it->rad2);
+    maxc=geom::Max(maxc,tpos+it->rad2);
   }
   minc-=1.0;
   maxc+=1.0;
-- 
GitLab