Overlay Engine: Option to Disable AA Ortho Grid
[blender.git] / source / blender / draw / modes / object_mode.c
index 786146d..1072efb 100644 (file)
@@ -511,6 +511,7 @@ static void OBJECT_engine_init(void *vedata)
     const bool show_axis_y = (v3d->gridflag & V3D_SHOW_Y) != 0;
     const bool show_axis_z = (v3d->gridflag & V3D_SHOW_Z) != 0;
     const bool show_floor = (v3d->gridflag & V3D_SHOW_FLOOR) != 0;
+    const bool show_ortho_grid = (v3d->gridflag & V3D_SHOW_ORTHO_GRID) != 0;
     e_data.draw_grid = show_axis_x || show_axis_y || show_axis_z || show_floor;
 
     DRW_viewport_matrix_get(winmat, DRW_MAT_WIN);
@@ -559,15 +560,15 @@ static void OBJECT_engine_init(void *vedata)
       grid_res = viewdist / grid_scale;
 
       if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT)) {
-        e_data.draw_grid = true;
+        e_data.draw_grid = show_ortho_grid;
         e_data.grid_flag = PLANE_YZ | SHOW_AXIS_Y | SHOW_AXIS_Z | SHOW_GRID | GRID_BACK;
       }
       else if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM)) {
-        e_data.draw_grid = true;
+        e_data.draw_grid = show_ortho_grid;
         e_data.grid_flag = PLANE_XY | SHOW_AXIS_X | SHOW_AXIS_Y | SHOW_GRID | GRID_BACK;
       }
       else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK)) {
-        e_data.draw_grid = true;
+        e_data.draw_grid = show_ortho_grid;
         e_data.grid_flag = PLANE_XZ | SHOW_AXIS_X | SHOW_AXIS_Z | SHOW_GRID | GRID_BACK;
       }
       else { /* RV3D_VIEW_USER */