Skip to content

Commit

Permalink
Tree plotting: retain the chosen plot mode when tree is changed
Browse files Browse the repository at this point in the history
We were previously switching back to length mode,
leaving the menu out of synch.
  • Loading branch information
shawnlaffan committed Jan 9, 2024
1 parent 11f4772 commit 0ca0409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Biodiverse/GUI/Tabs/Labels.pm
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ sub on_selected_phylogeny_changed {
$self->set_phylogeny_options_sensitive(1);
}
else {
$self->{dendrogram}->set_cluster(undef, 'length');
$self->{dendrogram}->set_cluster(undef, $self->{plot_mode} //= 'length');
$self->set_phylogeny_options_sensitive(0);
my $str = '<i>No selected tree</i>';
$self->get_xmlpage_object('label_VL_tree')->set_markup($str);
Expand Down
4 changes: 2 additions & 2 deletions lib/Biodiverse/GUI/Tabs/Spatial.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1126,11 +1126,11 @@ sub on_selected_phylogeny_changed {
$self->{dendrogram}->clear;
}
if ($phylogeny) {
$self->{dendrogram}->set_cluster($phylogeny, 'length'); # now storing tree objects directly
$self->{dendrogram}->set_cluster($phylogeny, $self->{plot_mode} //= 'length'); # now storing tree objects directly
$self->set_phylogeny_options_sensitive(1);
}
else {
$self->{dendrogram}->set_cluster(undef, 'length');
$self->{dendrogram}->set_cluster(undef, $self->{plot_mode} //= 'length');
$self->set_phylogeny_options_sensitive(0);
my $str = '<i>No selected tree</i>';
$self->get_xmlpage_object('spatial_label_VL_tree')->set_markup($str);
Expand Down

0 comments on commit 0ca0409

Please sign in to comment.