Fix T76150: Viewport Axes not toggling correctly when 'Floor' and 'Grid' are turned off

Fix T76150
While comparing with the deleted file [1] in the commit [2], saw this
little addition which most probably was added for optimisation.
Removing it fixes the behaviour too.

To test:
- In Viewport Overlays > Guides, uncheck both Grid & Floor.
- Try toggling all three axes individually.
- Z just sticks. X cannot be shown without Y enabled.

[1] https://developer.blender.org/diffusion/B/change/master/source/blender/draw/modes/object_mode.c;9516921c05bd9fee5c94942eb8e38f47ba7e4351
[2] {rB9516921c05bd9fee5c94942eb8e38f47ba7e4351}

Reviewed By: fclem

Maniphest Tasks: T76150

Differential Revision: https://developer.blender.org/D7568
This commit is contained in:
Ankit 2020-05-14 16:19:47 +02:00 committed by Clément Foucault
parent ada03e8673
commit b7386c66f9
Notes: blender-bot 2023-02-13 22:43:24 +01:00
Referenced by issue #76150, Viewport Axes not toggling correctly when 'Floor' and 'Grid' are turned off
2 changed files with 4 additions and 2 deletions

@ -1 +1 @@
Subproject commit 590710871b7b2e1f7f50bb622f1409b794ad38c2
Subproject commit 47a32a5370d36942674621e5a03e57e8dd4986d8

View File

@ -60,8 +60,10 @@ void OVERLAY_grid_init(OVERLAY_Data *vedata)
const bool show_ortho_grid = (pd->v3d_gridflag & V3D_SHOW_ORTHO_GRID) != 0;
shd->grid_flag = 0;
shd->zneg_flag = 0;
shd->zpos_flag = 0;
if (pd->hide_overlays || !(show_axis_y || show_axis_z || show_floor || show_ortho_grid)) {
if (pd->hide_overlays || !pd->v3d_gridflag) {
return;
}