diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-11-02 22:13:51 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-11-02 22:14:03 +0300 |
commit | 5ed4e1e23ab19282a8673bdeba3724026b80a880 (patch) | |
tree | 21df31ab26f881939a3f3f48f92ff16211911a0d /source/blender/editors/transform | |
parent | ef4aa42ea4ffa1bf7f5ad7f8e7f7b6acf9e3c3e6 (diff) |
Fix T77819: Snap Incremental does not match grid in all cases
The behavior of the incremental snap did not take into account the
relative dimensions of the window, which resulted in a different behavior
if the area height was greater than the width.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1b1740cd5bc..9f4777a716d 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1626,11 +1626,9 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) static void initSnapSpatial(TransInfo *t, float r_snap[2]) { if (t->spacetype == SPACE_VIEW3D) { - RegionView3D *rv3d = t->region->regiondata; - - if (rv3d) { + if (t->region->regiondata) { View3D *v3d = t->area->spacedata.first; - r_snap[0] = ED_view3d_grid_view_scale(t->scene, v3d, rv3d, NULL) * 1.0f; + r_snap[0] = ED_view3d_grid_view_scale(t->scene, v3d, t->region, NULL) * 1.0f; r_snap[1] = r_snap[0] * 0.1f; } } |