INNER CODE UNIT · Dart
dY
vintage/scratcher · lib/widgets.dart:225
final dY = center.dy - point.dy;
final multi = dX * dX + dY * dY;
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