Sketcher: Bspline tool: prevent double click failure (#23872)
* Sketcher: Bspline tool: prevent double click failure * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update DrawSketchHandlerBSpline.h * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -515,6 +515,12 @@ private:
|
||||
sketchgui->getSketchObject()->solve();
|
||||
}
|
||||
else if (state() == SelectMode::SeekSecond) {
|
||||
// Prevent adding a new point if it's coincident with the last one.
|
||||
if (!points.empty()
|
||||
&& (prevCursorPosition - getLastPoint()).Length() < Precision::Confusion()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We stay in SeekSecond unless the user closed the bspline.
|
||||
bool isClosed = false;
|
||||
|
||||
@@ -776,7 +782,9 @@ private:
|
||||
for (auto& point : points) {
|
||||
bsplinePoints3D.emplace_back(point.x, point.y, 0.0);
|
||||
}
|
||||
if (onlyeditoutline) {
|
||||
|
||||
double len = (prevCursorPosition - getLastPoint()).Length();
|
||||
if (onlyeditoutline && (points.empty() || len >= Precision::Confusion())) {
|
||||
bsplinePoints3D.emplace_back(prevCursorPosition.x, prevCursorPosition.y, 0.0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user