my ( $last_x, $last_y ) = ( 0,0 );
-my @path;
+our @path;
sub curve {
return unless $#path > 4;
my $curve = Math::CatmullRom->new( splice @path, 0, $#path + $#path / 2 );
- my @curve = $curve->curve( $mouse_trashold * $max_path_length / 2 );
+ my @curve = $curve->curve( $mouse_trashold * 10 );
debug 'curve' => @curve;
my $i = 0;
if ( $mouse_down && ( $dx > $mouse_trashold || $dy > $mouse_trashold ) ) {
if ( $#path < $max_path_length ) {
push @path, $x, $y;
- my $rect = SDL::Rect->new( -x => $event->motion_x, -y => $event->motion_y, -w => 3, -h => 3 );
+ my $rect = SDL::Rect->new( -x => $event->motion_x - 1, -y => $event->motion_y -1 , -w => 3, -h => 3 );
$app->fill( $rect, $white );
$app->update( $rect );
$last_x = $x;