LayoutHelperRoundLayoutValue Method
Calculates the value to be used for layout rounding at high DPI by rounding the value
up or down to the nearest pixel.
Namespace: Avalonia.LayoutAssembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
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
- value Double
- Input value to be rounded.
- dpiScale Double
- Ratio of screen's DPI to layout DPI
DoubleAdjusted value that will produce layout rounding on screen at high dpi.
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.