drawLandmarkMarker function

void drawLandmarkMarker(
  1. Canvas canvas,
  2. double x,
  3. double y, {
  4. double glowRadius = 8,
  5. double pointRadius = 5,
  6. double centerRadius = 2,
  7. Paint? glowPaint,
  8. Paint? pointPaint,
  9. Paint? centerPaint,
})

Draw a standard "glow + point + center dot" triple-circle landmark marker at (x, y) in canvas coordinates.

Any of the three layers can be omitted by passing a null Paint. The radii default to the conventional 8/5/2 used across the detector example overlays; tweak for pixel-perfect parity with a custom design.

Callers typically pre-scale the landmark coordinate before calling, e.g.

drawLandmarkMarker(
  canvas,
  landmark.x * scaleX + offsetX,
  landmark.y * scaleY + offsetY,
  glowPaint: _glow, pointPaint: _point, centerPaint: _dot,
);

Implementation

void drawLandmarkMarker(
  Canvas canvas,
  double x,
  double y, {
  double glowRadius = 8,
  double pointRadius = 5,
  double centerRadius = 2,
  Paint? glowPaint,
  Paint? pointPaint,
  Paint? centerPaint,
}) {
  final center = Offset(x, y);
  if (glowPaint != null) canvas.drawCircle(center, glowRadius, glowPaint);
  if (pointPaint != null) canvas.drawCircle(center, pointRadius, pointPaint);
  if (centerPaint != null) canvas.drawCircle(center, centerRadius, centerPaint);
}