RoundLayoutValue Method
Calculates the value to be used for layout rounding at high DPI by rounding the value up or down to the nearest pixel.
Definition
Namespace: Avalonia.Layout
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static double RoundLayoutValue(
double value,
double dpiScale
)
Public Shared Function RoundLayoutValue (
value As Double,
dpiScale As Double
) As Double
static member RoundLayoutValue :
value : float *
dpiScale : float -> float
Parameters
Return Value
Double
Adjusted value that will produce layout rounding on screen at high 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.