Skip to content

Commit

Permalink
ADDED: change arrow direction if box selected has one arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
nkh committed Nov 4, 2023
1 parent 7865d1f commit 5f9a8cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
3 changes: 0 additions & 3 deletions Todo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
buildah run $c -- apt install libdata-compare-perl libdata-compare-perl libdirectory-scratch-structured-perl libeval-context-perl libextutils-pkgconfig-perl libfile-homedir-perl libgtk3-perl libio-prompter-perl libterm-size-any-perl libterm-termkey-perl libtest-block-perl libtermkey-dev libmodule-build-perl

latest Data::TreeDumper

constraints
alignement
Expand Down
25 changes: 17 additions & 8 deletions lib/App/Asciio/Actions/Arrow.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,30 @@ $self->update_display() if $changes_made ;
sub change_arrow_direction
{
my ($self) = @_ ;
my $changes_made = 0 ;

for (grep {ref $_ eq 'App::Asciio::stripes::section_wirl_arrow'} $self->get_selected_elements(1))
my @selection = $self->get_selected_elements(1) ;
my @arrows ;

if (1 == @selection && ref $selection[0] eq 'App::Asciio::stripes::editable_box2')
{
$self->create_undo_snapshot() unless $changes_made++ ;
$_->change_section_direction($self->{MOUSE_X} - $_->{X}, $self->{MOUSE_Y} - $_->{Y}) ;
my @connections = $self->get_connections_containing(@selection) ;
@arrows = $connections[0]{CONNECTED} if 1 == @connections ;
}

for (grep {ref $_ eq 'App::Asciio::stripes::angled_arrow'} $self->get_selected_elements(1))
push @arrows, grep {ref $_ eq 'App::Asciio::stripes::angled_arrow'} @selection ;
push @arrows, grep {ref $_ eq 'App::Asciio::stripes::section_wirl_arrow'} @selection ;

for (@arrows)
{
$self->create_undo_snapshot() unless $changes_made++ ;
$_->change_direction() ;
$self->create_undo_snapshot() ;

$_->change_direction() if ref $_ eq 'App::Asciio::stripes::angled_arrow' ;

$_->change_section_direction($self->{MOUSE_X} - $_->{X}, $self->{MOUSE_Y} - $_->{Y})
if ref $_ eq 'App::Asciio::stripes::section_wirl_arrow' ;
}

$self->update_display() if $changes_made ;
$self->update_display() if @arrows ;
}

#----------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 5f9a8cc

Please sign in to comment.