diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-02-16 12:37:40 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-02-16 12:37:40 +0300 |
commit | d836477e082733a240cf2f2a350342fbef8910ad (patch) | |
tree | 34d672146f45ebefe44ad56c462f64ad9ae9c4a8 | |
parent | 1a4a4dc398039fea9ed9c4407cbd209d3b61fc3c (diff) | |
parent | 50269acb807077ca66743aa7720862d9e707b808 (diff) |
Merge branch 'CURA-7970_voronoi_graph_integer_rounding' into CURA-7970_voronoi_graph_integer_rounding_experimentsCURA-7970_voronoi_graph_integer_rounding_experiments
-rw-r--r-- | src/utils/VoronoiUtils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/VoronoiUtils.cpp b/src/utils/VoronoiUtils.cpp index b06370fae..cf801db94 100644 --- a/src/utils/VoronoiUtils.cpp +++ b/src/utils/VoronoiUtils.cpp @@ -13,7 +13,9 @@ namespace cura Point VoronoiUtils::p(const vd_t::vertex_type* node) { - return Point(node->x() + 0.5d, node->y() + 0.5d); //Round to nearest integer coordinates. + const double x = node->x(); + const double y = node->y(); + return Point(x + 0.5d - (x < 0), y + 0.5d - (y < 0)); //Round to nearest integer coordinates. } bool VoronoiUtils::isSourcePoint(Point p, const vd_t::cell_type& cell, const std::vector<Point>& points, const std::vector<Segment>& segments, coord_t snap_dist) |