Visual preview for bed shape dialog

This commit is contained in:
Alessandro Ranellucci 2014-08-03 00:20:55 +02:00
parent 3ff613d166
commit f462af20f9
7 changed files with 164 additions and 14 deletions

View file

@ -268,6 +268,15 @@ Pointf::translate(double x, double y)
this->y += y;
}
void
Pointf::rotate(double angle, const Pointf &center)
{
double cur_x = this->x;
double cur_y = this->y;
this->x = center.x + cos(angle) * (cur_x - center.x) - sin(angle) * (cur_y - center.y);
this->y = center.y + cos(angle) * (cur_y - center.y) + sin(angle) * (cur_x - center.x);
}
#ifdef SLIC3RXS
REGISTER_CLASS(Pointf, "Pointf");

View file

@ -71,6 +71,7 @@ class Pointf
explicit Pointf(coordf_t _x = 0, coordf_t _y = 0): x(_x), y(_y) {};
void scale(double factor);
void translate(double x, double y);
void rotate(double angle, const Pointf &center);
#ifdef SLIC3RXS
bool from_SV(SV* point_sv);