[Bf-blender-cvs] [6623d572aa5] master: Cleanup: minor changes and comments to screen_bounds_get access
Campbell Barton
noreply at git.blender.org
Mon Jan 25 03:50:23 CET 2021
Commit: 6623d572aa55591059bbbc60b75d414700763720
Author: Campbell Barton
Date: Mon Jan 25 13:49:32 2021 +1100
Branches: master
https://developer.blender.org/rB6623d572aa55591059bbbc60b75d414700763720
Cleanup: minor changes and comments to screen_bounds_get access
===================================================================
M source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
M source/blender/windowmanager/gizmo/WM_gizmo_types.h
M source/blender/windowmanager/gizmo/wm_gizmo_fn.h
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index 7404778f960..07264f75d19 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -352,7 +352,7 @@ static int gizmo_axis_cursor_get(wmGizmo *UNUSED(gz))
return WM_CURSOR_DEFAULT;
}
-static void gizmo_axis_bounds(bContext *C, wmGizmo *gz, rcti *r_bounding_box)
+static void gizmo_axis_screen_bounds_get(bContext *C, wmGizmo *gz, rcti *r_bounding_box)
{
ScrArea *area = CTX_wm_area(C);
const float rad = WIDGET_RADIUS;
@@ -371,7 +371,7 @@ void VIEW3D_GT_navigate_rotate(wmGizmoType *gzt)
gzt->draw = gizmo_axis_draw;
gzt->test_select = gizmo_axis_test_select;
gzt->cursor_get = gizmo_axis_cursor_get;
- gzt->screen_bounds_get = gizmo_axis_bounds;
+ gzt->screen_bounds_get = gizmo_axis_screen_bounds_get;
gzt->struct_size = sizeof(wmGizmo);
}
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_types.h b/source/blender/windowmanager/gizmo/WM_gizmo_types.h
index 0588fd2b2ce..fd7f9c2de7c 100644
--- a/source/blender/windowmanager/gizmo/WM_gizmo_types.h
+++ b/source/blender/windowmanager/gizmo/WM_gizmo_types.h
@@ -371,7 +371,12 @@ typedef struct wmGizmoType {
*/
wmGizmoFnMatrixBasisGet matrix_basis_get;
- /** Returns screen-space bounding box. Needed for nice tooltip placement. */
+ /**
+ * Returns screen-space bounding box in the window space
+ * (compatible with #wmEvent.x #wmEvent.y).
+ *
+ * Used for tool-tip placement (otherwise the cursor location is used).
+ */
wmGizmoFnScreenBoundsGet screen_bounds_get;
/** Activate a gizmo state when the user clicks on it. */
diff --git a/source/blender/windowmanager/gizmo/wm_gizmo_fn.h b/source/blender/windowmanager/gizmo/wm_gizmo_fn.h
index 4eea7cc6dcf..84e6308223f 100644
--- a/source/blender/windowmanager/gizmo/wm_gizmo_fn.h
+++ b/source/blender/windowmanager/gizmo/wm_gizmo_fn.h
@@ -59,12 +59,12 @@ typedef int (*wmGizmoFnModal)(struct bContext *,
eWM_GizmoFlagTweak);
typedef void (*wmGizmoFnPropertyUpdate)(struct wmGizmo *, struct wmGizmoProperty *);
typedef void (*wmGizmoFnMatrixBasisGet)(const struct wmGizmo *, float[4][4]);
-typedef void (*wmGizmoFnScreenBoundsGet)(struct bContext *,
- struct wmGizmo *,
- rcti *r_bounding_box);
typedef int (*wmGizmoFnInvoke)(struct bContext *, struct wmGizmo *, const struct wmEvent *);
typedef void (*wmGizmoFnExit)(struct bContext *, struct wmGizmo *, const bool);
typedef int (*wmGizmoFnCursorGet)(struct wmGizmo *);
+typedef void (*wmGizmoFnScreenBoundsGet)(struct bContext *,
+ struct wmGizmo *,
+ rcti *r_bounding_box);
typedef void (*wmGizmoFnSelectRefresh)(struct wmGizmo *);
typedef void (*wmGizmoFnFree)(struct wmGizmo *);
More information about the Bf-blender-cvs
mailing list