diff options
author | Yevgeny Makarov <jenkm> | 2020-03-09 19:08:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-03-09 19:11:24 +0300 |
commit | 07bdbeda8462c36fc7cff086b1fb31ee3ddbca0d (patch) | |
tree | ff41af3bf8fe6115f3b97b25020f6e596abd00d5 | |
parent | aca222c3da20c0c48d12124af4c4041579a5690e (diff) |
UI: avoid blurring of view navigation widgets at some UI scales
Differential Revision: https://developer.blender.org/D6734
-rw-r--r-- | source/blender/editors/interface/view2d_gizmo_navigate.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_gizmo_navigate.c | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/interface/view2d_gizmo_navigate.c b/source/blender/editors/interface/view2d_gizmo_navigate.c index a11ba0476e1..fd309045899 100644 --- a/source/blender/editors/interface/view2d_gizmo_navigate.c +++ b/source/blender/editors/interface/view2d_gizmo_navigate.c @@ -228,13 +228,13 @@ static void WIDGETGROUP_navigate_draw_prepare(const bContext *C, wmGizmoGroup *g int icon_mini_slot = 0; gz = navgroup->gz_array[GZ_INDEX_ZOOM]; - gz->matrix_basis[3][0] = co[0]; - gz->matrix_basis[3][1] = co[1] - (icon_offset_mini * icon_mini_slot++); + gz->matrix_basis[3][0] = roundf(co[0]); + gz->matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++)); WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); gz = navgroup->gz_array[GZ_INDEX_MOVE]; - gz->matrix_basis[3][0] = co[0]; - gz->matrix_basis[3][1] = co[1] - (icon_offset_mini * icon_mini_slot++); + gz->matrix_basis[3][0] = roundf(co[0]); + gz->matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++)); WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c index 0d55fcda6a9..422cba7c52e 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c @@ -307,25 +307,25 @@ static void WIDGETGROUP_navigate_draw_prepare(const bContext *C, wmGizmoGroup *g if (show_navigate) { int icon_mini_slot = 0; gz = navgroup->gz_array[GZ_INDEX_ZOOM]; - gz->matrix_basis[3][0] = co[0]; - gz->matrix_basis[3][1] = co[1] - (icon_offset_mini * icon_mini_slot++); + gz->matrix_basis[3][0] = roundf(co[0]); + gz->matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++)); WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); gz = navgroup->gz_array[GZ_INDEX_MOVE]; - gz->matrix_basis[3][0] = co[0]; - gz->matrix_basis[3][1] = co[1] - (icon_offset_mini * icon_mini_slot++); + gz->matrix_basis[3][0] = roundf(co[0]); + gz->matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++)); WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); if ((rv3d->viewlock & RV3D_LOCKED) == 0) { gz = navgroup->gz_array[GZ_INDEX_CAMERA]; - gz->matrix_basis[3][0] = co[0]; - gz->matrix_basis[3][1] = co[1] - (icon_offset_mini * icon_mini_slot++); + gz->matrix_basis[3][0] = roundf(co[0]); + gz->matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++)); WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); if (navgroup->state.rv3d.is_camera == false) { gz = navgroup->gz_array[rv3d->is_persp ? GZ_INDEX_PERSP : GZ_INDEX_ORTHO]; - gz->matrix_basis[3][0] = co[0]; - gz->matrix_basis[3][1] = co[1] - (icon_offset_mini * icon_mini_slot++); + gz->matrix_basis[3][0] = roundf(co[0]); + gz->matrix_basis[3][1] = roundf(co[1] - (icon_offset_mini * icon_mini_slot++)); WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false); } } |