[Bf-blender-cvs] [b1d8aeeab2e] master: Snap: Decrease the distance of the incremental snap in ortho view

Germano Cavalcante noreply at git.blender.org
Mon Dec 28 15:45:06 CET 2020


Commit: b1d8aeeab2eb0db984d912e6ff6b5181cb6b603a
Author: Germano Cavalcante
Date:   Mon Dec 28 11:43:39 2020 -0300
Branches: master
https://developer.blender.org/rBb1d8aeeab2eb0db984d912e6ff6b5181cb6b603a

Snap: Decrease the distance of the incremental snap in ortho view

This matches more the older versions (as shown in the T77819).

===================================================================

M	source/blender/editors/space_view3d/view3d_draw.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 797c7d73df3..5e61d9d6250 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -956,16 +956,14 @@ float ED_view3d_grid_view_scale(Scene *scene,
   RegionView3D *rv3d = region->regiondata;
   if (!rv3d->is_persp && RV3D_VIEW_IS_AXIS(rv3d->view)) {
     /* Decrease the distance between grid snap points depending on zoom. */
-    /* `0.38` was a value visually obtained in order to get a snap distance
-     * that matches previous versions Blender.*/
-    float min_dist = 16.0f / (region->sizex * rv3d->winmat[0][0]);
+    float dist = 12.0f / (region->sizex * rv3d->winmat[0][0]);
     float grid_steps[STEPS_LEN];
     ED_view3d_grid_steps(scene, v3d, rv3d, grid_steps);
     /* Skip last item, in case the 'mid_dist' is greater than the largest unit. */
     int i;
     for (i = 0; i < ARRAY_SIZE(grid_steps) - 1; i++) {
       grid_scale = grid_steps[i];
-      if (grid_scale > min_dist) {
+      if (grid_scale > dist) {
         break;
       }
     }



More information about the Bf-blender-cvs mailing list