Skip to content

Commit 7b397d9

Browse files
committed
[BUGFIX] Show active bed texture when bed model overlaps
When bed models are too large they are automatically hidden when another bed is added to avoid awkward spacing between beds/overlaps. This also results in the bed texture being hidden and falling back to the default "translucent" grid view. This bugfix changes the behavior to show the bed texture on the active bed even when the model is hidden which should be save as the texture is always scaled to the bed size. Original bug report: prusa3d#13791
1 parent 4a5e778 commit 7b397d9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/slic3r/GUI/3DBed.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,17 @@ void Bed3D::render_axes()
412412

413413
void Bed3D::render_system(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom, bool show_texture, bool is_active)
414414
{
415-
if (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1) {
415+
if (m_texture_filename.empty() && m_model_filename.empty()) {
416416
render_default(bottom, false, show_texture, view_matrix, projection_matrix);
417417
return;
418418
}
419419

420-
if (!bottom)
420+
if (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1) {
421+
if (m_texture_filename.empty())
422+
render_default(bottom, false, show_texture, view_matrix, projection_matrix);
423+
} else if (!bottom) {
421424
render_model(view_matrix, projection_matrix);
425+
}
422426

423427
if (show_texture)
424428
render_texture(bottom, canvas, view_matrix, projection_matrix, is_active);
@@ -580,14 +584,17 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj
580584

581585
void Bed3D::render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom, bool show_texture, bool picking, bool is_active)
582586
{
583-
if ((m_texture_filename.empty() && m_model_filename.empty())
584-
|| (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1)) {
587+
if (m_texture_filename.empty() && m_model_filename.empty()) {
585588
render_default(bottom, picking, show_texture, view_matrix, projection_matrix);
586589
return;
587590
}
588591

589-
if (!bottom)
592+
if (m_models_overlap && s_multiple_beds.get_number_of_beds() + int(s_multiple_beds.should_show_next_bed()) > 1) {
593+
if (m_texture_filename.empty())
594+
render_default(bottom, false, show_texture, view_matrix, projection_matrix);
595+
} else if (!bottom) {
590596
render_model(view_matrix, projection_matrix);
597+
}
591598

592599
if (show_texture)
593600
render_texture(bottom, canvas, view_matrix, projection_matrix, is_active);

0 commit comments

Comments
 (0)