scaleFromStandard method
Scales the current Offset from a standard canvas size to the device canvas size.
This method is the inverse of scaleToStandard. It scales the current offset coordinates (dx, dy) from the standard canvas size back to the device canvas size. This is particularly useful when rendering coordinates that were captured on a device with a different resolution.
The scaling is based on the ratio of the device canvas size to the standard canvas size.
deviceCanvasSize is the size of the canvas on the current device.
Returns a new Offset that is scaled from the standard canvas size to the device's canvas size.
Implementation
Offset scaleFromStandard(Size deviceCanvasSize) {
final scaleX = deviceCanvasSize.width / standardWidth;
final scaleY = deviceCanvasSize.height / standardHeight;
return Offset(dx * scaleX, dy * scaleY);
}