Skip to content

Commit

Permalink
Version to 0.33, add tests from kekoa
Browse files Browse the repository at this point in the history
Contributors updated to add kekoa.

Changes updated to 0.33.
  • Loading branch information
benkasminbullock committed Jun 27, 2020
1 parent ad92dd1 commit 97a7754
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Revision history for perl module Image::SVG::Path

0.33 2020-06-27

* Add support for no_shortcuts and absolute for quadratic beziers (kekoa)
* Improve support for smooth curves (kekoa)

0.32 2017-11-07

* Split path rather than use regex (Alexander Gorlov)
Expand Down
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ WriteMakefile (
'Alessandro Ranellucci <aar@cpan.org>',
'Colin Kuskie <colink@cpan.org>',
'Alexander Gorlov',
'kekoa',
],
},
MIN_PERL_VERSION => '5.006001',
Expand Down
2 changes: 1 addition & 1 deletion lib/Image/SVG/Path.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ our @SVG_REGEX = qw/
our @FUNCTIONS = qw/extract_path_info reverse_path create_path_string/;
our @EXPORT_OK = (@FUNCTIONS, @SVG_REGEX);
our %EXPORT_TAGS = (all => \@FUNCTIONS, regex => \@SVG_REGEX);
our $VERSION = '0.32';
our $VERSION = '0.33';

use Carp;

Expand Down
24 changes: 24 additions & 0 deletions t/Image-SVG-Path.t
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,30 @@ my $path22 = 'M21.3 10.5v.5c0 4.7-3.5 10.1-9.9 10.1-2 0-3.8-.6-5.3-1.6.3 0 .6.1.
my @info2 = extract_path_info ($path22);#, {verbose => 1});
ok (@info2);

# Test no_smooth on smooth cubic beziers with and without previous cubic.

my $nscb = 'M5,4s1,1,2,2s2,1,3,1';
my @nscb = extract_path_info ($nscb, {absolute => 1, no_smooth => 1});

is_deeply ($nscb[1]{control1}, [5,4], "reuse start point");
is_deeply ($nscb[1]{control2}, [6,5]);
is_deeply ($nscb[1]{end}, [7,6]);
is_deeply ($nscb[2]{control1}, [8,7], "reflect previous control point");
is_deeply ($nscb[2]{control2}, [9,7]);
is_deeply ($nscb[2]{end}, [10,7]);

# Test no_smooth on smooth quadratic beziers with and without previous
# quadratic.

my $nsqb = 'M5,1t1,1M3,5q1,1,2,2t2,2';
my @nsqb = extract_path_info ($nsqb, {absolute => 1, no_smooth => 1});

is_deeply ($nsqb[1]{control}, [5,1], "reuse start point");
is_deeply ($nsqb[1]{end}, [6,2]);
is_deeply ($nsqb[3]{control}, [4,6]);
is_deeply ($nsqb[3]{end}, [5,7]);
is_deeply ($nsqb[4]{control}, [6,8], "reflect previous control point");
is_deeply ($nsqb[4]{end}, [7,9]);

done_testing ();
exit;

0 comments on commit 97a7754

Please sign in to comment.