LayoutHelper.

RoundLayoutValue(double, double) Method

Summary

Calculates the value to be used for layout rounding at high DPI.
Namespace
Avalonia.Layout
Containing Type
LayoutHelper

Syntax

public static double RoundLayoutValue(double value, double dpiScale)

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.

Parameters

Name Type Description
value double Input value to be rounded.
dpiScale double Ratio of screen's DPI to layout DPI

Return Value

Type Description
double Adjusted value that will produce layout rounding on screen at high dpi.