diff --git a/lib/Biodiverse/GUI/Dendrogram.pm b/lib/Biodiverse/GUI/Dendrogram.pm index 2470df796..05f2fe0e7 100644 --- a/lib/Biodiverse/GUI/Dendrogram.pm +++ b/lib/Biodiverse/GUI/Dendrogram.pm @@ -1248,13 +1248,16 @@ sub recolour_cluster_lines { my $analysis_max = $self->{analysis_max}; my $colour_mode = $self->get_cluster_colour_mode(); - my $legend = $map->get_legend; - $legend->set_colour_mode_from_list_and_index ( - list => $list_name, - index => $list_index, - ); - my @minmax_args = ($analysis_min, $analysis_max); - my $colour_method = $legend->get_colour_method; + my ($legend, @minmax_args, $colour_method); + if ($colour_mode ne 'palette' and not $self->in_multiselect_mode) { + $legend = $map->get_legend; + $legend->set_colour_mode_from_list_and_index( + list => $list_name, + index => $list_index, + ); + @minmax_args = ($analysis_min, $analysis_max); + $colour_method = $legend->get_colour_method; + } foreach my $node_ref (@$cluster_nodes) { diff --git a/lib/Biodiverse/GUI/Tabs/Labels.pm b/lib/Biodiverse/GUI/Tabs/Labels.pm index 4dd02f25f..7bb0ce47b 100644 --- a/lib/Biodiverse/GUI/Tabs/Labels.pm +++ b/lib/Biodiverse/GUI/Tabs/Labels.pm @@ -994,6 +994,7 @@ sub on_selected_labels_changed { else { $grid->set_legend_log_mode_off; } + my $legend = $grid->get_legend; my $colour_func = sub { my $elt = shift; @@ -1003,7 +1004,7 @@ sub on_selected_labels_changed { #if ($use_log) { # $val = log ($val + 1); #} - return $grid->get_colour($val, 0, $display_max_value); + return $legend->get_colour($val, 0, $display_max_value); }; $grid->colour($colour_func);