summaryrefslogtreecommitdiff
path: root/tools/source/generic/b3dtrans.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-15 08:48:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-17 08:25:06 +0200
commit16690220ed6e68f2e9674a09b5008f38c5e6ed8d (patch)
tree2f830b7ac23f136585e7dc4adf5d456f4995cc99 /tools/source/generic/b3dtrans.cxx
parent86d70dc840b88ed827d6d8febaf512264009951d (diff)
loplugin:singlevalfields
tighten up the handling of binary operators Change-Id: I262ec57bf7142fa094d240738150a94d83fd15ee Reviewed-on: https://gerrit.libreoffice.org/61777 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools/source/generic/b3dtrans.cxx')
-rw-r--r--tools/source/generic/b3dtrans.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx
index f892b11a5154..99aee062eafc 100644
--- a/tools/source/generic/b3dtrans.cxx
+++ b/tools/source/generic/b3dtrans.cxx
@@ -21,6 +21,11 @@
#include <osl/diagnose.h>
+ // Near and far clipping planes
+static constexpr double gfNearBound = 0.001;
+static constexpr double gfFarBound = 1.001;
+
+
// B3dTransformationSet --------------------------------------------------------
// Transformations for all 3D output
@@ -142,8 +147,6 @@ void B3dTransformationSet::Reset()
mfLeftBound = mfBottomBound = -1.0;
mfRightBound = mfTopBound = 1.0;
- mfNearBound = 0.001;
- mfFarBound = 1.001;
mfRatio = 0.0;
@@ -250,16 +253,16 @@ void B3dTransformationSet::CalcViewport()
// OpenGL needs a little more rough additional size to not let
// the front face vanish. Changed from SMALL_DVALUE to 0.000001,
// which is 1/10000th, comared with 1/tenth of a million from SMALL_DVALUE.
- const double fDistPart((mfFarBound - mfNearBound) * 0.0001);
+ const double fDistPart((gfFarBound - gfNearBound) * 0.0001);
// To avoid critical clipping, set Near & Far generously
if(mbPerspective)
{
- Frustum(aNewProjection, fLeft, fRight, fBottom, fTop, mfNearBound - fDistPart, mfFarBound + fDistPart);
+ Frustum(aNewProjection, fLeft, fRight, fBottom, fTop, gfNearBound - fDistPart, gfFarBound + fDistPart);
}
else
{
- Ortho(aNewProjection, fLeft, fRight, fBottom, fTop, mfNearBound - fDistPart, mfFarBound + fDistPart);
+ Ortho(aNewProjection, fLeft, fRight, fBottom, fTop, gfNearBound - fDistPart, gfFarBound + fDistPart);
}
// Set to true to guarantee loop termination