From e90bc3fcabafb333bb6e7db8fe65e20f9ca6613d Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 14 May 2018 09:00:19 +0200 Subject: Fix in _3DScene::_load_gcode_extrusion_paths::Helper::path_color() --- xs/src/slic3r/GUI/3DScene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xs/src/slic3r/GUI/3DScene.cpp b/xs/src/slic3r/GUI/3DScene.cpp index 85018404c..df8b1fbfc 100644 --- a/xs/src/slic3r/GUI/3DScene.cpp +++ b/xs/src/slic3r/GUI/3DScene.cpp @@ -2204,7 +2204,7 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data, return 0.0f; } - static const GCodePreviewData::Color path_color(const GCodePreviewData& data, const std::vector& tool_colors, float value) + static GCodePreviewData::Color path_color(const GCodePreviewData& data, const std::vector& tool_colors, float value) { switch (data.extrusion.view_type) { @@ -2220,7 +2220,7 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data, return data.get_volumetric_rate_color(value); case GCodePreviewData::Extrusion::Tool: { - static GCodePreviewData::Color color; + GCodePreviewData::Color color; ::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + (unsigned int)value * 4), 4 * sizeof(float)); return color; } -- cgit v1.2.3 From 5fb81bacd526d8d460fb8eebe7d8aa464697c991 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 14 May 2018 09:54:38 +0200 Subject: Added layer index under sliders in 3D view --- lib/Slic3r/GUI/Plater/3DPreview.pm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/GUI/Plater/3DPreview.pm b/lib/Slic3r/GUI/Plater/3DPreview.pm index 9d8b82242..b746de98f 100644 --- a/lib/Slic3r/GUI/Plater/3DPreview.pm +++ b/lib/Slic3r/GUI/Plater/3DPreview.pm @@ -58,6 +58,13 @@ sub new { [40,-1], wxALIGN_CENTRE_HORIZONTAL); $z_label_high->SetFont($Slic3r::GUI::small_font); + my $z_label_low_idx = $self->{z_label_low_idx} = Wx::StaticText->new($self, -1, "", wxDefaultPosition, + [40,-1], wxALIGN_CENTRE_HORIZONTAL); + $z_label_low_idx->SetFont($Slic3r::GUI::small_font); + my $z_label_high_idx = $self->{z_label_high_idx} = Wx::StaticText->new($self, -1, "", wxDefaultPosition, + [40,-1], wxALIGN_CENTRE_HORIZONTAL); + $z_label_high_idx->SetFont($Slic3r::GUI::small_font); + $self->single_layer(0); my $checkbox_singlelayer = $self->{checkbox_singlelayer} = Wx::CheckBox->new($self, -1, L("1 Layer")); @@ -103,11 +110,13 @@ sub new { my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL); my $vsizer = Wx::BoxSizer->new(wxVERTICAL); my $vsizer_outer = Wx::BoxSizer->new(wxVERTICAL); - $vsizer->Add($slider_low, 3, 0, 0); - $vsizer->Add($z_label_low, 0, 0, 0); + $vsizer->Add($slider_low, 3, wxALIGN_CENTER_HORIZONTAL, 0); + $vsizer->Add($z_label_low_idx, 0, wxALIGN_CENTER_HORIZONTAL, 0); + $vsizer->Add($z_label_low, 0, wxALIGN_CENTER_HORIZONTAL, 0); $hsizer->Add($vsizer, 0, wxEXPAND, 0); $vsizer = Wx::BoxSizer->new(wxVERTICAL); - $vsizer->Add($slider_high, 3, 0, 0); + $vsizer->Add($slider_high, 3, wxALIGN_CENTER_HORIZONTAL, 0); + $vsizer->Add($z_label_high_idx, 0, wxALIGN_CENTER_HORIZONTAL, 0); $vsizer->Add($z_label_high, 0, 0, 0); $hsizer->Add($vsizer, 0, wxEXPAND, 0); $vsizer_outer->Add($hsizer, 3, wxALIGN_CENTER_HORIZONTAL, 0); @@ -325,6 +334,8 @@ sub load_print { $self->slider_high->Hide; $self->{z_label_low}->SetLabel(""); $self->{z_label_high}->SetLabel(""); + $self->{z_label_low_idx}->SetLabel(""); + $self->{z_label_high_idx}->SetLabel(""); $self->canvas->reset_legend_texture(); $self->canvas->Refresh; # clears canvas return; @@ -427,6 +438,10 @@ sub set_z_range return if !$self->enabled; $self->{z_label_low}->SetLabel(sprintf '%.2f', $z_low); $self->{z_label_high}->SetLabel(sprintf '%.2f', $z_high); + my $z_idx_low = 1 + $self->slider_low->GetValue; + my $z_idx_high = 1 + $self->slider_high->GetValue; + $self->{z_label_low_idx}->SetLabel(sprintf '%d', $z_idx_low); + $self->{z_label_high_idx}->SetLabel(sprintf '%d', $z_idx_high); $self->canvas->set_toolpaths_range($z_low - 1e-6, $z_high + 1e-6); $self->canvas->Refresh if $self->IsShown; } -- cgit v1.2.3 From b07e16a3e7ed210c0dc297ed862f33ed938cb821 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Mon, 14 May 2018 21:14:33 +0930 Subject: Fix build failure (#884) --- Build.PL | 1 + 1 file changed, 1 insertion(+) diff --git a/Build.PL b/Build.PL index e006d11eb..8f882fc4b 100644 --- a/Build.PL +++ b/Build.PL @@ -12,6 +12,7 @@ my %prereqs = qw( ExtUtils::ParseXS 3.22 ExtUtils::XSpp 0 ExtUtils::Typemaps 0 + ExtUtils::Typemaps::Basic 0 File::Basename 0 File::Spec 0 Getopt::Long 0 -- cgit v1.2.3