mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 21:14:01 -06:00
Replaced Moose with Moo => big performance boost and easier packaging
This commit is contained in:
parent
bf5824781d
commit
26b05ab155
13 changed files with 67 additions and 75 deletions
|
@ -1,28 +1,24 @@
|
|||
package Slic3r::Point;
|
||||
use Moose;
|
||||
use Moose::Util::TypeConstraints;
|
||||
|
||||
subtype 'Slic3r::Point::Coordinate', as 'Int';
|
||||
coerce 'Slic3r::Point::Coordinate', from 'Num', via { sprintf '%.0f', $_ };
|
||||
use Moo;
|
||||
|
||||
has 'x' => (
|
||||
is => 'ro',
|
||||
isa => 'Slic3r::Point::Coordinate',
|
||||
#isa => 'Slic3r::Point::Coordinate',
|
||||
required => 1,
|
||||
coerce => 1,
|
||||
coerce => sub { sprintf '%.0f', $_[0] },
|
||||
);
|
||||
|
||||
has 'y' => (
|
||||
is => 'ro',
|
||||
isa => 'Slic3r::Point::Coordinate',
|
||||
#isa => 'Slic3r::Point::Coordinate',
|
||||
required => 1,
|
||||
coerce => 1,
|
||||
coerce => sub { sprintf '%.0f', $_[0] },
|
||||
);
|
||||
|
||||
# this array contains weak references, so it can contain undef's as well
|
||||
has 'lines' => (
|
||||
is => 'rw',
|
||||
isa => 'ArrayRef[Slic3r::Line]',
|
||||
#isa => 'ArrayRef[Slic3r::Line]',
|
||||
default => sub { [] },
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue