mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 18:42:24 +00:00
Replaced Moose with Moo => big performance boost and easier packaging
This commit is contained in:
@@ -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 { [] },
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user