PsPathPoint.fromPixels constructor

PsPathPoint.fromPixels({
  1. required double x,
  2. required double y,
  3. required int width,
  4. required int height,
})

Creates a normalized point from pixel coordinates and positive dimensions.

Implementation

factory PsPathPoint.fromPixels({
  required double x,
  required double y,
  required int width,
  required int height,
}) {
  if (width <= 0 || height <= 0) {
    throw ArgumentError('Path reference dimensions must be positive');
  }
  return PsPathPoint(x: x / width, y: y / height);
}