diff options
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index cdd8d571400..45caadf3742 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -79,6 +79,8 @@ #include "ED_view3d.h" #include "ED_space_api.h" +#include "DEG_depsgraph.h" + #include "gpencil_intern.h" /* ************************************************ */ @@ -1463,7 +1465,7 @@ static int gp_snap_to_cursor(bContext *C, wmOperator *op) View3D *v3d = CTX_wm_view3d(C); const bool use_offset = RNA_boolean_get(op->ptr, "use_offset"); - const float *cursor_global = ED_view3d_cursor3d_get(scene, v3d); + const float *cursor_global = ED_view3d_cursor3d_get(scene, v3d)->location; for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { /* only editable and visible layers are considered */ @@ -1550,7 +1552,7 @@ static int gp_snap_cursor_to_sel(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); - float *cursor = ED_view3d_cursor3d_get(scene, v3d); + float *cursor = ED_view3d_cursor3d_get(scene, v3d)->location; float centroid[3] = {0.0f}; float min[3], max[3]; size_t count = 0; @@ -1605,7 +1607,7 @@ static int gp_snap_cursor_to_sel(bContext *C, wmOperator *UNUSED(op)) } } - if (v3d->around == V3D_AROUND_CENTER_MEAN && count) { + if (scene->toolsettings->transform_pivot_point == V3D_AROUND_CENTER_MEAN && count) { mul_v3_fl(centroid, 1.0f / (float)count); copy_v3_v3(cursor, centroid); } @@ -2099,7 +2101,6 @@ static int gp_strokes_reproject_poll(bContext *C) static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) { - Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); GP_SpaceConversion gsc = {NULL}; eGP_ReprojectModes mode = RNA_boolean_get(op->ptr, "type"); @@ -2109,8 +2110,9 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) /* init autodist for geometry projection */ if (mode == GP_REPROJECT_SURFACE) { + struct Depsgraph *depsgraph = CTX_data_depsgraph(C); view3d_region_operator_needs_opengl(CTX_wm_window(C), gsc.ar); - ED_view3d_autodist_init(bmain, scene, gsc.ar, CTX_wm_view3d(C), 0); + ED_view3d_autodist_init(depsgraph, gsc.ar, CTX_wm_view3d(C), 0); } // TODO: For deforming geometry workflow, create new frames? |