AlignmentUtils.RoundToPanelPixelSize

Declaration

public static float RoundToPanelPixelSize(UIElements.VisualElement ve, float v);

Description

Round the value so that it is a whole number of pixels on the target when rendered.

It will only work on visualElements inside a panel.

Is is used to get dimensions repesenting whole pixels used for layout values, translations or in the generation of the visual Content. It does not consider the transform of the element and its ancestors.

This method uses the scaling from [see cref="VisualElement.scaledPixelsPerPoint"/> and uses the same rounding thresholds as the layout engine.


Did you find this page useful? Please give it a rating: