diff --git a/src/Bnd/Bnd_Box.lxx b/src/Bnd/Bnd_Box.lxx index f42707fa20..edf29b7e57 100644 --- a/src/Bnd/Bnd_Box.lxx +++ b/src/Bnd/Bnd_Box.lxx @@ -21,8 +21,8 @@ inline Standard_Real Bnd_Box::SquareExtent() const { if ( IsVoid() ) return 0.; - Standard_Real dx = Xmax-Xmin+Gap; - Standard_Real dy = Ymax-Ymin+Gap; - Standard_Real dz = Zmax-Zmin+Gap; - return dx*dx + dy*dy + dz*dz; + const Standard_Real aDx = Xmax - Xmin + Gap + Gap; + const Standard_Real aDy = Ymax - Ymin + Gap + Gap; + const Standard_Real aDz = Zmax - Zmin + Gap + Gap; + return aDx*aDx + aDy*aDy + aDz*aDz; } diff --git a/src/Bnd/Bnd_Box2d.lxx b/src/Bnd/Bnd_Box2d.lxx index 346aac6268..57697d66b0 100644 --- a/src/Bnd/Bnd_Box2d.lxx +++ b/src/Bnd/Bnd_Box2d.lxx @@ -238,8 +238,8 @@ inline Standard_Boolean Bnd_Box2d::IsOut (const gp_Trsf2d& T1, inline Standard_Real Bnd_Box2d::SquareExtent() const { if ( IsVoid() ) return 0.; - Standard_Real dx = Xmax-Xmin+Gap; - Standard_Real dy = Ymax-Ymin+Gap; - return dx*dx + dy*dy; + const Standard_Real aDx = Xmax - Xmin + Gap + Gap; + const Standard_Real aDy = Ymax - Ymin + Gap + Gap; + return aDx*aDx + aDy*aDy; }