diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-27 09:47:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-27 09:47:30 +0300 |
commit | 355d1299654aa9861318df500e4d532c612a1cb9 (patch) | |
tree | 434e9b0e3974be72236f93e8039861445198fcec /source/blender/editors/include/ED_gizmo_library.h | |
parent | 1f7a791a539287c8f1cabc0f20f4c727e0fb36dc (diff) |
Gizmo: lazy initialize snap context
ED_gizmotypes_snap_3d_context_get could have returned NULL,
rename _get(..) to _ensure(..) and initialize the snap context
in this function.
Diffstat (limited to 'source/blender/editors/include/ED_gizmo_library.h')
-rw-r--r-- | source/blender/editors/include/ED_gizmo_library.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/include/ED_gizmo_library.h b/source/blender/editors/include/ED_gizmo_library.h index 47ecbd73c9a..20b7b755234 100644 --- a/source/blender/editors/include/ED_gizmo_library.h +++ b/source/blender/editors/include/ED_gizmo_library.h @@ -257,7 +257,10 @@ void ED_gizmotypes_snap_3d_draw_util(struct RegionView3D *rv3d, const uchar color_line[4], const uchar color_point[4], const short snap_elem_type); -struct SnapObjectContext *ED_gizmotypes_snap_3d_context_get(struct wmGizmo *gz); +struct SnapObjectContext *ED_gizmotypes_snap_3d_context_ensure(struct Scene *scene, + const struct ARegion *region, + const struct View3D *v3d, + struct wmGizmo *gz); short ED_gizmotypes_snap_3d_update(struct wmGizmo *gz, struct Depsgraph *depsgraph, const struct ARegion *region, |