Cleanup: use define for golden ratio
Move from workbench_private.h where it wasn't used.
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
#include "workbench_engine.h"
|
#include "workbench_engine.h"
|
||||||
|
|
||||||
#define WORKBENCH_ENGINE "BLENDER_WORKBENCH"
|
#define WORKBENCH_ENGINE "BLENDER_WORKBENCH"
|
||||||
#define M_GOLDEN_RATION_CONJUGATE 0.618033988749895
|
|
||||||
#define MAX_COMPOSITE_SHADERS (1 << 7)
|
#define MAX_COMPOSITE_SHADERS (1 << 7)
|
||||||
#define MAX_PREPASS_SHADERS (1 << 8)
|
#define MAX_PREPASS_SHADERS (1 << 8)
|
||||||
#define MAX_ACCUM_SHADERS (1 << 8)
|
#define MAX_ACCUM_SHADERS (1 << 8)
|
||||||
|
@@ -98,6 +98,8 @@
|
|||||||
|
|
||||||
#include "view3d_intern.h" /* own include */
|
#include "view3d_intern.h" /* own include */
|
||||||
|
|
||||||
|
#define M_GOLDEN_RATION_CONJUGATE 0.618033988749895f
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/** \name General Functions
|
/** \name General Functions
|
||||||
* \{ */
|
* \{ */
|
||||||
@@ -450,7 +452,7 @@ static void drawviewborder_triangle(
|
|||||||
|
|
||||||
if (w > h) {
|
if (w > h) {
|
||||||
if (golden) {
|
if (golden) {
|
||||||
ofs = w * (1.0f - (1.0f / 1.61803399f));
|
ofs = w * (1.0f - (1.0f / M_GOLDEN_RATION_CONJUGATE));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ofs = h * (h / w);
|
ofs = h * (h / w);
|
||||||
@@ -470,7 +472,7 @@ static void drawviewborder_triangle(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (golden) {
|
if (golden) {
|
||||||
ofs = h * (1.0f - (1.0f / 1.61803399f));
|
ofs = h * (1.0f - (1.0f / M_GOLDEN_RATION_CONJUGATE));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ofs = w * (w / h);
|
ofs = w * (w / h);
|
||||||
@@ -660,7 +662,7 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *ar, View
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ca->dtx & CAM_DTX_GOLDEN) {
|
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) {
|
if (ca->dtx & CAM_DTX_GOLDEN_TRI_A) {
|
||||||
|
Reference in New Issue
Block a user