LayoutHelperRoundLayoutSizeUp Method
Rounds a size to integer values for layout purposes, compensating for high DPI screen
coordinates by rounding the size up to the nearest pixel.
Namespace: Avalonia.LayoutAssembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static Size RoundLayoutSizeUp(
Size size,
double dpiScaleX,
double dpiScaleY
)
Public Shared Function RoundLayoutSizeUp (
size As Size,
dpiScaleX As Double,
dpiScaleY As Double
) As Size
static member RoundLayoutSizeUp :
size : Size *
dpiScaleX : float *
dpiScaleY : float -> Size
- size Size
- Input size.
- dpiScaleX Double
- DPI along x-dimension.
- dpiScaleY Double
- DPI along y-dimension.
SizeValue of size that will be rounded under screen 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.