FIX: tree support crashes when it's too short

jira: STUDIO-8277
Change-Id: I327d9fb7beb6cc2822131ca4954066217b1a5c9b
This commit is contained in:
Arthur 2024-09-26 15:30:40 +08:00 committed by Lane.Wei
parent c29f728526
commit 00e5e84bbd
1 changed files with 1 additions and 1 deletions

View File

@ -2200,7 +2200,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 = std::move(intersection_ex(floor_areas, below_layer->lslices));
if (!bottom_gap_area.empty()) {