Method GetPixelSnappingOffset
GetPixelSnappingOffset(SKCanvas)
Computes the pixel-snapping offset (in canvas/logical coordinates) that aligns 1px strokes to device pixel centers, taking the canvas TotalMatrix into account. Returns an SKPoint { X = offsetX, Y = offsetY } where: offsetX = 0.5f / effectiveScaleX offsetY = 0.5f / effectiveScaleY Use: canvas.Save(); canvas.Translate(offset.X, offset.Y); ... canvas.Restore();
public static SKPoint GetPixelSnappingOffset(SKCanvas canvas)
Parameters
canvasSKCanvasThe SKCanvas to inspect (must not be null).
Returns
- SKPoint
Pixel-snapping offset in canvas coordinates.