Skip to content

Commit

Permalink
GUI tree plotting: no need to set plot/group mode if unchanged
Browse files Browse the repository at this point in the history
Avoids some double firing of events.
  • Loading branch information
shawnlaffan committed Jan 4, 2024
1 parent e5be430 commit 3f46a55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Biodiverse/GUI/Tabs/Clustering.pm
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ sub get_tree_menu_items {
my $dendro_plot_mode_callback = sub {
my ($self, $mode_string) = @_;
$mode_string ||= 'length';
return if $self->{plot_mode} eq $mode_string;
say "[Clustering tab] Changing mode to $mode_string";
$self->{plot_mode} = $mode_string;
my $dendrogram = $self->{dendrogram};
Expand All @@ -352,6 +353,7 @@ sub get_tree_menu_items {
my $dendro_select_mode_callback = sub {
my ($self, $mode_string) = @_;
$mode_string ||= 'length';
return if $self->{group_mode} eq $mode_string;
say "[Clustering tab] Changing selection mode to $mode_string";
$self->{group_mode} = $mode_string;
my $dendrogram = $self->{dendrogram};
Expand Down
1 change: 1 addition & 0 deletions lib/Biodiverse/GUI/Tabs/Labels.pm
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ sub get_tree_menu_items {
my $dendro_plot_mode_callback = sub {
my ($self, $mode_string) = @_;
$mode_string ||= 'length';
return if $self->{plot_mode} eq $mode_string;
say "[Labels tab] Changing mode to $mode_string";
$self->{plot_mode} = $mode_string;
return if !$self->{project}->get_selected_phylogeny;
Expand Down

0 comments on commit 3f46a55

Please sign in to comment.