diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2021-01-25 02:16:05 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2021-01-25 02:16:05 +0300 |
commit | cf6d17a6aa421e0038fc1f8e60e3f1f708887c3e (patch) | |
tree | 30eeb91c88f0c3c4552fcf2255582d439e69b899 /source/blender/windowmanager | |
parent | 2fec46c3e614c10cadef945855747d0f3f251fd4 (diff) |
UI: Gizmo Tooltip Positioning
Position Gizmo tooltips below their bounds so they do not obscure the content.
Differential Revision: https://developer.blender.org/D9793
Reviewed by Julian Eisel
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/gizmo/WM_gizmo_types.h | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/gizmo/wm_gizmo_fn.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_types.h b/source/blender/windowmanager/gizmo/WM_gizmo_types.h index 8f84c02be12..0588fd2b2ce 100644 --- a/source/blender/windowmanager/gizmo/WM_gizmo_types.h +++ b/source/blender/windowmanager/gizmo/WM_gizmo_types.h @@ -371,6 +371,9 @@ typedef struct wmGizmoType { */ wmGizmoFnMatrixBasisGet matrix_basis_get; + /** Returns screen-space bounding box. Needed for nice tooltip placement. */ + wmGizmoFnScreenBoundsGet screen_bounds_get; + /** Activate a gizmo state when the user clicks on it. */ wmGizmoFnInvoke invoke; diff --git a/source/blender/windowmanager/gizmo/wm_gizmo_fn.h b/source/blender/windowmanager/gizmo/wm_gizmo_fn.h index 418e848e35b..4eea7cc6dcf 100644 --- a/source/blender/windowmanager/gizmo/wm_gizmo_fn.h +++ b/source/blender/windowmanager/gizmo/wm_gizmo_fn.h @@ -59,6 +59,9 @@ 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 *); |