From 8040ef8efb4862c8fa7dda89890e03392543f38f Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 11 Apr 2017 11:16:47 +0200 Subject: [PATCH] Fixing a bug in the layer editor for high diameter nozzles. https://github.com/prusa3d/Slic3r/issues/247 --- lib/Slic3r/GUI/3DScene.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index d4eb1eaea..db21b3409 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -1470,11 +1470,13 @@ sub draw_active_object_annotations { my $max_z = unscale($print_object->size->z); my $profile = $print_object->model_object->layer_height_profile; my $layer_height = $print_object->config->get('layer_height'); + my $layer_heights_max = $print_object->print->config->get('max_layer_height'); + my $layer_height_max = my $max = max(@{$layer_heights_max}) * 1.12; # Baseline glColor3f(0., 0., 0.); glBegin(GL_LINE_STRIP); - glVertex2f($bar_left + $layer_height * ($bar_right - $bar_left) / 0.45, $bar_bottom); - glVertex2f($bar_left + $layer_height * ($bar_right - $bar_left) / 0.45, $bar_top); + glVertex2f($bar_left + $layer_height * ($bar_right - $bar_left) / $layer_height_max, $bar_bottom); + glVertex2f($bar_left + $layer_height * ($bar_right - $bar_left) / $layer_height_max, $bar_top); glEnd(); # Curve glColor3f(0., 0., 1.); @@ -1482,7 +1484,7 @@ sub draw_active_object_annotations { for (my $i = 0; $i < int(@{$profile}); $i += 2) { my $z = $profile->[$i]; my $h = $profile->[$i+1]; - glVertex3f($bar_left + $h * ($bar_right - $bar_left) / 0.45, $bar_bottom + $z * ($bar_top - $bar_bottom) / $max_z, $z); + glVertex3f($bar_left + $h * ($bar_right - $bar_left) / $layer_height_max, $bar_bottom + $z * ($bar_top - $bar_bottom) / $max_z, $z); } glEnd(); # Revert the matrices.