Skip to content

Commit

Permalink
Merge pull request #4 from alexrj/patch-2
Browse files Browse the repository at this point in the history
Support scientific notation in coordinates. #3
  • Loading branch information
benkasminbullock committed Dec 6, 2013
2 parents 1a1250d + 81c2943 commit 1366fef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Image/SVG/Path.pm
Expand Up @@ -99,8 +99,8 @@ sub create_path_string
}

# The following regular expression splits the path into pieces

my $split_re = qr/(?:,|(?=-)|\s+)/;
# Note we only split on '-' when it's not preceeded by 'e'
my $split_re = qr/(?:,|(?<!e)(?=-)|\s+)/;

sub extract_path_info
{
Expand Down Expand Up @@ -147,7 +147,7 @@ sub extract_path_info
};
# Deal with the rest of the path.
my @curves;
while ($curves =~ /([cslqtahvz])\s*([-0-9.,\s]*)/gi) {
while ($curves =~ /([cslqtahvz])\s*([-0-9.,e\s]*)/gi) {
push @curves, [$1, $2];
}
if (@curves == 0) {
Expand Down Expand Up @@ -311,7 +311,7 @@ __END__
=head1 NAME
Image::SVG::Path - read the "d" attribute of an SVG path
Image::SVG::Path - reasd the "d" attribute of an SVG path
=head1 SYNOPSIS
Expand Down

0 comments on commit 1366fef

Please sign in to comment.