Cleanup: use define for golden ratio

Move from workbench_private.h where it wasn't used.
This commit is contained in:
Campbell Barton
2020-02-15 12:05:05 +11:00
parent f37b9ffdcb
commit 52da1b6e2b
2 changed files with 5 additions and 4 deletions

View File

@@ -35,7 +35,6 @@
#include "workbench_engine.h"
#define WORKBENCH_ENGINE "BLENDER_WORKBENCH"
#define M_GOLDEN_RATION_CONJUGATE 0.618033988749895
#define MAX_COMPOSITE_SHADERS (1 << 7)
#define MAX_PREPASS_SHADERS (1 << 8)
#define MAX_ACCUM_SHADERS (1 << 8)

View File

@@ -98,6 +98,8 @@
#include "view3d_intern.h" /* own include */
#define M_GOLDEN_RATION_CONJUGATE 0.618033988749895f
/* -------------------------------------------------------------------- */
/** \name General Functions
* \{ */
@@ -450,7 +452,7 @@ static void drawviewborder_triangle(
if (w > h) {
if (golden) {
ofs = w * (1.0f - (1.0f / 1.61803399f));
ofs = w * (1.0f - (1.0f / M_GOLDEN_RATION_CONJUGATE));
}
else {
ofs = h * (h / w);
@@ -470,7 +472,7 @@ static void drawviewborder_triangle(
}
else {
if (golden) {
ofs = h * (1.0f - (1.0f / 1.61803399f));
ofs = h * (1.0f - (1.0f / M_GOLDEN_RATION_CONJUGATE));
}
else {
ofs = w * (w / h);
@@ -660,7 +662,7 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *ar, View
}
if (ca->dtx & CAM_DTX_GOLDEN) {
drawviewborder_grid3(shdr_pos, x1, x2, y1, y2, 1.0f - (1.0f / 1.61803399f));
drawviewborder_grid3(shdr_pos, x1, x2, y1, y2, 1.0f - (1.0f / M_GOLDEN_RATION_CONJUGATE));
}
if (ca->dtx & CAM_DTX_GOLDEN_TRI_A) {