mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 18:15:56 +08:00
correction key to grid around zero
This commit is contained in:
parent
7a375abddb
commit
452473c370
@ -39,7 +39,12 @@ public:
|
||||
: m_cell_size(cell_size), m_cell_size_half(cell_size / 2) {}
|
||||
|
||||
Key cell_id(const Point &point) const {
|
||||
return Key(point.x() / m_cell_size, point.y() / m_cell_size);
|
||||
Key::coord_type x = point.x() / m_cell_size;
|
||||
Key::coord_type y = point.y() / m_cell_size;
|
||||
// correction around zero => -1 / 5 = 0
|
||||
if (point.x() < 0) --x;
|
||||
if (point.y() < 0) --y;
|
||||
return Key{x, y};
|
||||
}
|
||||
|
||||
void add(LayerSupportPoint &&point) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user