Avoid too close points being added to a drawing_line

This commit is contained in:
2026-02-05 18:23:28 +01:00
parent f615ed5654
commit 3b12be497e
2 changed files with 19 additions and 11 deletions

View File

@@ -64,8 +64,10 @@ class DrawingController extends ChangeNotifier {
void addPoint(Offset normalizedPoint) {
if (_currentLine == null) return;
_currentLine = _currentLine!.addPoint(normalizedPoint);
notifyListeners();
if (!currentLine!.isPointTooClose(normalizedPoint)) {
_currentLine = _currentLine!.addPoint(normalizedPoint);
notifyListeners();
}
}
/// Completes the current line and adds it to the history.