CURA-4869 Infill meshes influence layer count in layer view

If a layer is empty, don't add it to the total layer count!
This commit is contained in:
Ian Paschal 2018-02-14 16:56:07 +01:00
parent 64ea2399a1
commit 0b62a312c3

View File

@ -342,6 +342,11 @@ class SimulationView(View):
min_layer_number = sys.maxsize
max_layer_number = -sys.maxsize
for layer_id in layer_data.getLayers():
# If a layer doesn't contain any polygons, skip it (for infill meshes taller than print objects
if len(layer_data.getLayer(layer_id).polygons) < 1:
continue
# Store the max and min feedrates and thicknesses for display purposes
for p in layer_data.getLayer(layer_id).polygons:
self._max_feedrate = max(float(p.lineFeedrates.max()), self._max_feedrate)
@ -634,4 +639,3 @@ class _CreateTopLayersJob(Job):
def cancel(self):
self._cancel = True
super().cancel()