Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/dualcon/intern/Projections.h')
-rw-r--r--intern/dualcon/intern/Projections.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/intern/dualcon/intern/Projections.h b/intern/dualcon/intern/Projections.h
index 18533b218ff..1477dd9dccf 100644
--- a/intern/dualcon/intern/Projections.h
+++ b/intern/dualcon/intern/Projections.h
@@ -788,17 +788,17 @@ public:
LONG proj0 = cubeProj[i][0] ;
LONG proj1 = cubeProj[i][0] + cubeProj[i][edgeInd + 1] ;
LONG proj2 = inherit->trigProj[i][1] ;
+ LONG d = proj1 - proj0;
+ double alpha;
- // double alpha = (double)( ( proj2 - proj0 ) * cubeProj[edgeInd][edgeInd + 1] ) / (double)( proj1 - proj0 ) ;
- double alpha = (double)( ( proj2 - proj0 ) ) / (double)( proj1 - proj0 ) ;
-
- if ( alpha < 0 )
- {
- alpha = 0.5 ;
+ if (d == 0) {
+ alpha = 0.5;
}
- else if ( alpha > 1 )
- {
- alpha = 0.5 ;
+ else {
+ alpha = (double)((proj2 - proj0)) / (double)d;
+
+ if (alpha < 0 || alpha > 1)
+ alpha = 0.5;
}