is there a way to get the actual height (and width) of a VisualElement in pixels?
I tried visualElement.worldBound.height, visualElement.resolvedStyle.height and visualElement.layout.height, but they all ignore the scaling that is configured by uiDocument.panelSettings.scaleMode = PanelScaleMode.ScaleWithScreenSize.
uiDocument.panelSettings.scale does not return the actual scaling either.
Hey! I think there’s nothing exposed to get the resolved scale. You can calculate the scale using the reference resolution. Note that you will need to take in account the match mode and the match parameter.
Having access to a scale property on the UI Document object would be useful when constraining items within the screen using the UI Document coordinate system.
I am making windows draggable in the UI and making sure a window stays within the screen is a big help.