RoundLayoutThickness Method
Rounds a thickness to integer values for layout purposes, compensating for high DPI screen coordinates.
Definition
Namespace: Avalonia.Layout
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static Thickness RoundLayoutThickness(
Thickness thickness,
double dpiScaleX,
double dpiScaleY
)
Public Shared Function RoundLayoutThickness (
thickness As Thickness,
dpiScaleX As Double,
dpiScaleY As Double
) As Thickness
static member RoundLayoutThickness :
thickness : Thickness *
dpiScaleX : float *
dpiScaleY : float -> Thickness
Parameters
Return Value
Thickness
Value of thickness that will be rounded under screen DPI.
Remarks
This is a layout helper method. It takes DPI into account and also does not return the rounded value if it is unacceptable for layout, e.g. Infinity or NaN. It's a helper associated with the UseLayoutRounding property and should not be used as a general rounding utility.