canvasToNormalised function
Converts a canvas pixel offset to a normalised coordinate (0–1). Returns null if the point is outside the video content area.
Implementation
List<double>? canvasToNormalised(Offset position, VideoContentBounds bounds) {
final nx = (position.dx - bounds.left) / bounds.width;
final ny = (position.dy - bounds.top) / bounds.height;
if (nx < 0 || nx > 1 || ny < 0 || ny > 1) return null;
return [nx, ny, 0.5]; // pressure defaults to 0.5 on mobile
}