New ->scale() method for ExPolygon::XS
This commit is contained in:
parent
5409c27852
commit
e0052b01d3
3 changed files with 24 additions and 1 deletions
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 5;
|
||||
use Test::More tests => 6;
|
||||
|
||||
my $square = [ # ccw
|
||||
[100, 100],
|
||||
|
@ -30,4 +30,10 @@ my $clone = $expolygon->clone;
|
|||
is_deeply [ @$clone ], [$square, $hole_in_square], 'clone';
|
||||
# TODO: check that modifying the clone doesn't modify the original one
|
||||
|
||||
$expolygon->scale(1.5);
|
||||
is_deeply [ @$expolygon ], [
|
||||
[map [ 1.5*$_->[0], 1.5*$_->[1] ], @$square],
|
||||
[map [ 1.5*$_->[0], 1.5*$_->[1] ], @$hole_in_square]
|
||||
], 'scale';
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue