diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-02-15 04:05:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-02-15 07:24:03 +0300 |
commit | 52da1b6e2b54a79ae481ba6decad91af61444e9e (patch) | |
tree | 96b0bb3f9ecc701a5af28e10525021bd131f03a8 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | f37b9ffdcb9f6fc40b98168bae4c4838a3296935 (diff) |
Cleanup: use define for golden ratio
Move from workbench_private.h where it wasn't used.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 7bfb0460c41..f767d56de62 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -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) { |