| 1 | package SVG::Estimate::Role::EndToPoint; | ||
| 2 | $SVG::Estimate::Role::EndToPoint::VERSION = '1.0111'; | ||
| 3 | use strict; | ||
| 4 | use Moo::Role; | ||
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | SVG::Estimate::Role::EndToPoint - Change arguments from "end" to "point", mainly for Path command objects | ||
| 9 | |||
| 10 | =head1 VERSION | ||
| 11 | |||
| 12 | version 1.0111 | ||
| 13 | |||
| 14 | =cut | ||
| 15 | |||
| 16 | around BUILDARGS => sub { | ||
| 17 | my ($orig, $class, @args) = @_; | ||
| 18 | my $args = @args % 2 ? $args[0] : { @args }; | ||
| 19 | $args->{point} = $args->{end}; | ||
| 20 | return $class->$orig($args); | ||
| 21 | }; | ||
| 22 | |||
| 23 | |||
| 24 | 1; |