-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
104 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package App::Asciio::Actions::Eraser ; | ||
|
||
use strict ; use warnings ; | ||
|
||
use App::Asciio::Actions::Mouse ; | ||
|
||
#---------------------------------------------------------------------------------------------- | ||
|
||
sub eraser_enter | ||
{ | ||
my ($self) = @_ ; | ||
|
||
$self->change_cursor('dot') ; | ||
} | ||
|
||
#---------------------------------------------------------------------------------------------- | ||
|
||
sub eraser_escape | ||
{ | ||
my ($self) = @_ ; | ||
|
||
$self->change_cursor('left_ptr') ; | ||
} | ||
|
||
sub erase_elements | ||
{ | ||
my ($self, $event) = @_ ; | ||
my ($x, $y) = @{$event->{COORDINATES}}[0, 1] ; | ||
|
||
if($self->{PREVIOUS_X} != $x || $self->{PREVIOUS_Y} != $y) | ||
{ | ||
my @elements = grep { $self->is_over_element($_, $x, $y) } reverse @{$self->{ELEMENTS}} ; | ||
|
||
if(@elements) | ||
{ | ||
$self->create_undo_snapshot() ; | ||
$self->delete_elements(@elements) ; | ||
|
||
$self->update_display(); | ||
} | ||
} | ||
|
||
App::Asciio::Actions::Mouse::mouse_motion($self, $event) ; | ||
} | ||
|
||
#---------------------------------------------------------------------------------------------- | ||
|
||
1 ; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters