Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
| Show First 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | static int gizmo_axis_test_select(bContext *UNUSED(C), wmGizmo *gz, const int mval[2]) | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| static int gizmo_axis_cursor_get(wmGizmo *UNUSED(gz)) | static int gizmo_axis_cursor_get(wmGizmo *UNUSED(gz)) | ||||
| { | { | ||||
| return WM_CURSOR_DEFAULT; | return WM_CURSOR_DEFAULT; | ||||
| } | } | ||||
| static void gizmo_axis_screen_bounds_get(bContext *C, wmGizmo *gz, rcti *r_bounding_box) | static bool gizmo_axis_screen_bounds_get(bContext *C, wmGizmo *gz, rcti *r_bounding_box) | ||||
| { | { | ||||
| ScrArea *area = CTX_wm_area(C); | ScrArea *area = CTX_wm_area(C); | ||||
| const float rad = WIDGET_RADIUS; | const float rad = WIDGET_RADIUS; | ||||
| r_bounding_box->xmin = gz->matrix_basis[3][0] + area->totrct.xmin - rad; | r_bounding_box->xmin = gz->matrix_basis[3][0] + area->totrct.xmin - rad; | ||||
| r_bounding_box->ymin = gz->matrix_basis[3][1] + area->totrct.ymin - rad; | r_bounding_box->ymin = gz->matrix_basis[3][1] + area->totrct.ymin - rad; | ||||
| r_bounding_box->xmax = r_bounding_box->xmin + rad; | r_bounding_box->xmax = r_bounding_box->xmin + rad; | ||||
| r_bounding_box->ymax = r_bounding_box->ymin + rad; | r_bounding_box->ymax = r_bounding_box->ymin + rad; | ||||
| return true; | |||||
| } | } | ||||
| void VIEW3D_GT_navigate_rotate(wmGizmoType *gzt) | void VIEW3D_GT_navigate_rotate(wmGizmoType *gzt) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| gzt->idname = "VIEW3D_GT_navigate_rotate"; | gzt->idname = "VIEW3D_GT_navigate_rotate"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| gzt->draw = gizmo_axis_draw; | gzt->draw = gizmo_axis_draw; | ||||
| gzt->test_select = gizmo_axis_test_select; | gzt->test_select = gizmo_axis_test_select; | ||||
| gzt->cursor_get = gizmo_axis_cursor_get; | gzt->cursor_get = gizmo_axis_cursor_get; | ||||
| gzt->screen_bounds_get = gizmo_axis_screen_bounds_get; | gzt->screen_bounds_get = gizmo_axis_screen_bounds_get; | ||||
| gzt->struct_size = sizeof(wmGizmo); | gzt->struct_size = sizeof(wmGizmo); | ||||
| } | } | ||||