mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:09:00 +08:00
Merge pull request #1648 from Ultimaker/bugfix_CURA-3615_fix_raft_layer_count
CURA-3615 Fix total layer count when raft is enabled
This commit is contained in:
commit
38fe709736
@ -1,6 +1,8 @@
|
|||||||
# Copyright (c) 2015 Ultimaker B.V.
|
# Copyright (c) 2015 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the AGPLv3 or higher.
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
from UM.View.View import View
|
from UM.View.View import View
|
||||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
@ -253,8 +255,17 @@ class LayerView(View):
|
|||||||
if not layer_data:
|
if not layer_data:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if new_max_layers < len(layer_data.getLayers()):
|
min_layer_number = sys.maxsize
|
||||||
new_max_layers = len(layer_data.getLayers()) - 1
|
max_layer_number = -sys.maxsize
|
||||||
|
for layer_id in layer_data.getLayers():
|
||||||
|
if max_layer_number < layer_id:
|
||||||
|
max_layer_number = layer_id
|
||||||
|
if min_layer_number > layer_id:
|
||||||
|
min_layer_number = layer_id
|
||||||
|
layer_count = max_layer_number - min_layer_number
|
||||||
|
|
||||||
|
if new_max_layers < layer_count:
|
||||||
|
new_max_layers = layer_count
|
||||||
|
|
||||||
if new_max_layers > 0 and new_max_layers != self._old_max_layers:
|
if new_max_layers > 0 and new_max_layers != self._old_max_layers:
|
||||||
self._max_layers = new_max_layers
|
self._max_layers = new_max_layers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user