Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorJose Luis Perez Diez <jluis@escomposlinux.org>2013-09-10 19:14:49 +0400
committerJose Luis Perez Diez <jluis@escomposlinux.org>2013-09-10 19:14:49 +0400
commit69a92c10f0d9e0023b6bc03c39e3447741eb23ef (patch)
tree19ea53693fdc98d62b78dedec8f1a4a8bcb23ac7 /xs
parent2d3dae621a8c419f4770b76498dcf75f99379217 (diff)
Round results when rotating to minimize errors & pass the tests
Diffstat (limited to 'xs')
-rw-r--r--xs/src/Point.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xs/src/Point.cpp b/xs/src/Point.cpp
index 612d7b0b0..f496c70ba 100644
--- a/xs/src/Point.cpp
+++ b/xs/src/Point.cpp
@@ -22,8 +22,8 @@ Point::rotate(double angle, Point* center)
{
double cur_x = (double)this->x;
double cur_y = (double)this->y;
- this->x = (long)( (double)center->x + cos(angle) * (cur_x - (double)center->x) - sin(angle) * (cur_y - (double)center->y) );
- this->y = (long)( (double)center->y + cos(angle) * (cur_y - (double)center->y) + sin(angle) * (cur_x - (double)center->x) );
+ this->x = (long)round( (double)center->x + cos(angle) * (cur_x - (double)center->x) - sin(angle) * (cur_y - (double)center->y) );
+ this->y = (long)round( (double)center->y + cos(angle) * (cur_y - (double)center->y) + sin(angle) * (cur_x - (double)center->x) );
}
bool