LayoutHelperRoundLayoutValueUp Method

Calculates the value to be used for layout rounding at high DPI by rounding the value up to the nearest pixel.

Definition

Namespace: Avalonia.Layout
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static double RoundLayoutValueUp(
	double value,
	double dpiScale
)

Parameters

value  Double
Input value to be rounded.
dpiScale  Double
Ratio of screen's DPI to layout DPI

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.

See Also