Avoid too close points being added to a drawing_line
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user