Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2018-08-27 17:40:48 +0300
committermano-wii <germano.costa@ig.com.br>2018-08-27 17:40:48 +0300
commitc7a96651dfa47a72c3d5d7c21705ad2eaa7cc8a5 (patch)
treeed54b576e9a1141c3aad1187d19f7e70fd8a49b3 /source/blender/editors/space_view3d
parent9de320d8829157116878e078eb7801f306d242b6 (diff)
Fix unreported: the gridview is no longer computed, so the snapping functions have to use the actual grid scale.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 15be77ff6ab..11b2a7a2f47 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -80,12 +80,13 @@ static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
Object *obedit = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
RegionView3D *rv3d = CTX_wm_region_data(C);
+ View3D *v3d = CTX_wm_view3d(C);
TransVertStore tvs = {NULL};
TransVert *tv;
float gridf, imat[3][3], bmat[3][3], vec[3];
int a;
- gridf = rv3d->gridview;
+ gridf = ED_view3d_grid_scale(scene, v3d, NULL);
if (obedit) {
ViewLayer *view_layer = CTX_data_view_layer(C);
@@ -497,7 +498,7 @@ static int snap_curs_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
View3D *v3d = CTX_wm_view3d(C);
float gridf, *curs;
- gridf = rv3d->gridview;
+ gridf = ED_view3d_grid_scale(scene, v3d, NULL);
curs = ED_view3d_cursor3d_get(scene, v3d)->location;
curs[0] = gridf * floorf(0.5f + curs[0] / gridf);