INNER CODE UNIT · Dart
distance
vintage/scratcher · lib/widgets.dart:227
final distance = sqrt(multi).roundToDouble();
return distance <= radius;
}
void _addPoint(Offset position) {
// Ignore when same point is reported multiple times in a row
if (_lastPosition == position) {
return;
}
_lastPosition = position;
ui.Offset? point = position;
final scratchPoint = ScratchPoint(point, widget.brushSize);
// Ignore when starting point of new line has been already scratched
if (points.isNotEmpty && points.contains(scratchPoint)) {
if (points.last == null) {