diff options
-rw-r--r-- | source/blender/draw/intern/draw_view.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 8867c85ac2f..f56cbd68077 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -227,6 +227,9 @@ void DRW_draw_cursor(void) immUnbindProgram(); } + float original_proj[4][4]; + GPU_matrix_projection_get(original_proj); + GPU_matrix_push(); ED_region_pixelspace(ar); GPU_matrix_translate_2f(co[0] + 0.5f, co[1] + 0.5f); GPU_matrix_scale_2f(U.widget_unit, U.widget_unit); @@ -239,6 +242,8 @@ void DRW_draw_cursor(void) glDisable(GL_BLEND); glDisable(GL_LINE_SMOOTH); + GPU_matrix_pop(); + GPU_matrix_projection_set(original_proj); } } } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index b9db773aaee..f6b2c79b88b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -877,7 +877,7 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect) #ifdef WITH_INPUT_NDOF /* draw center and axis of rotation for ongoing 3D mouse navigation */ -static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d) +static void draw_rotation_guide(const RegionView3D *rv3d) { float o[3]; /* center of rotation */ float end[3]; /* endpoints for drawing */ @@ -1246,6 +1246,16 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar) Scene *scene = CTX_data_scene(C); wmWindowManager *wm = CTX_wm_manager(C); +#ifdef WITH_INPUT_NDOF + if ((U.ndof_flag & NDOF_SHOW_GUIDE) && + ((rv3d->viewlock & RV3D_LOCKED) == 0) && + (rv3d->persp != RV3D_CAMOB)) + { + /* TODO: draw something else (but not this) during fly mode */ + draw_rotation_guide(rv3d); + } +#endif + /* correct projection matrix */ ED_region_pixelspace(ar); |