ENH: do not clone object to plate boundary

Jira: none
Change-Id: I72f33d7633bd6ccd43cabbfd0262818b1655c21b
(cherry picked from commit 99ea969b30a25ddd063da5fb0e246ce01d4b6764)
This commit is contained in:
Arthur 2023-10-13 18:05:52 +08:00 committed by Lane.Wei
parent af1af05a98
commit 63c33c90e6
2 changed files with 8 additions and 6 deletions

View File

@ -4909,8 +4909,8 @@ std::vector<Vec2f> GLCanvas3D::get_empty_cells(const Vec2f start_point, const Ve
Vec2d vmin(build_volume.min.x(), build_volume.min.y()), vmax(build_volume.max.x(), build_volume.max.y());
BoundingBoxf bbox(vmin, vmax);
std::vector<Vec2f> cells;
for (float x = bbox.min.x(); x < bbox.max.x(); x += step(0))
for (float y = bbox.min.y(); y < bbox.max.y(); y += step(1))
for (float x = bbox.min.x()+step(0)/2; x < bbox.max.x()-step(0)/2; x += step(0))
for (float y = bbox.min.y()+step(1)/2; y < bbox.max.y()-step(1)/2; y += step(1))
{
cells.emplace_back(x, y);
}

View File

@ -458,10 +458,12 @@ void Selection::remove_curr_plate()
void Selection::clone(int numbers)
{
if (numbers > 0)
if (numbers <= 0)
return;
wxGetApp().plater()->take_snapshot(std::string("Selection-clone"));
for (int i = 0; i < numbers; i++) {
copy_to_clipboard();
for (int i = 0; i < numbers; i++) {
paste_from_clipboard();
}
}