Better polymorphism for ExPolygon::XS->rotate

This commit is contained in:
Alessandro Ranellucci
2013-07-14 16:03:06 +02:00
parent 28a4f1a61e
commit 06de21b154
6 changed files with 32 additions and 21 deletions

View File

@@ -40,6 +40,14 @@ point2perl(Point& point) {
return sv_bless(newRV_noinc((SV*)av), gv_stashpv("Slic3r::Point", GV_ADD));
}
void
perl2point(SV* point_sv, Point& point)
{
AV* point_av = (AV*)SvRV(point_sv);
point.x = (unsigned long)SvIV(*av_fetch(point_av, 0, 0));
point.y = (unsigned long)SvIV(*av_fetch(point_av, 1, 0));
}
}
#endif