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/gpencil/gpencil_edit.c
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/gpencil/gpencil_edit.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index d8fb5bed5af..3d169dceb4c 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -2025,9 +2025,11 @@ static int gp_snap_to_grid(bContext *C, wmOperator *UNUSED(op))
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
RegionView3D *rv3d = CTX_wm_region_data(C);
- Depsgraph *depsgraph = CTX_data_depsgraph(C); \
+ View3D *v3d = CTX_wm_view3d(C);
+ Scene *scene = CTX_data_scene(C);
+ Depsgraph *depsgraph = CTX_data_depsgraph(C);
Object *obact = CTX_data_active_object(C);
- const float gridf = rv3d->gridview;
+ const float gridf = ED_view3d_grid_scale(scene, v3d, NULL);
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
/* only editable and visible layers are considered */