diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index be69999e0..83b8db79d 100644 --- a/scripts/xyz_grid.py +++ b/scripts/xyz_grid.py @@ -393,7 +393,7 @@ class XYZGridScript(scripts_manager.Script): return processed # something broke, no further handling needed. have_grid = 1 if include_grid else 0 - have_subgrids = len(zs) if len(zs) > 1 and include_subgrids else 0 + have_subgrids = len(zs) if len(zs) > 1 and (include_grid or include_subgrids) else 0 # sub-grids are created whenever the main grid is, see draw_xyz_grid have_images = processed.images[have_grid+have_subgrids:] processed.infotexts[:have_grid+have_subgrids] = grid_infotext[:have_grid+have_subgrids] # update infotexts with grid and subgrid info log.debug(f'XYZ grid: grid={have_grid} subgrids={have_subgrids} images={len(have_images)} total={len(processed.images)}') diff --git a/scripts/xyz_grid_on.py b/scripts/xyz_grid_on.py index df17c4fb0..26eaeee64 100644 --- a/scripts/xyz_grid_on.py +++ b/scripts/xyz_grid_on.py @@ -422,7 +422,7 @@ class XYZGridScript(scripts_manager.Script): return processed # something broke, no further handling needed. have_grid = 1 if include_grid else 0 - have_subgrids = len(zs) if len(zs) > 1 and include_subgrids else 0 + have_subgrids = len(zs) if len(zs) > 1 and (include_grid or include_subgrids) else 0 # sub-grids are created whenever the main grid is, see draw_xyz_grid have_images = processed.images[have_grid+have_subgrids:] processed.infotexts[:have_grid+have_subgrids] = grid_infotext[:have_grid+have_subgrids] # update infotexts with grid and subgrid info log.debug(f'XYZ grid: grid={have_grid} subgrids={have_subgrids} images={len(have_images)} total={len(processed.images)}')