FIX: tree support crashes when it's too short

jira: STUDIO-8277
Change-Id: I327d9fb7beb6cc2822131ca4954066217b1a5c9b
(cherry picked from commit 00e5e84bbdfb680da74c4861a56ec8f5a867f58d)
This commit is contained in:
Arthur 2024-09-26 15:30:40 +08:00 committed by Noisyfox
parent 724d8a12b6
commit e6880a468b

View file

@ -2136,7 +2136,7 @@ void TreeSupport::draw_circles()
base_areas = std::move(diff_ex(base_areas, offset_ex(floor_areas, 10)));
}
}
if (bottom_gap_layers > 0 && layer_nr > bottom_gap_layers) {
if (bottom_gap_layers > 0 && m_ts_data->layer_heights[layer_nr].obj_layer_nr > bottom_gap_layers) {
const Layer* below_layer = m_object->get_layer(m_ts_data->layer_heights[layer_nr].obj_layer_nr - bottom_gap_layers);
ExPolygons bottom_gap_area = intersection_ex(floor_areas, below_layer->lslices);
if (!bottom_gap_area.empty()) {