Added ComputedNode.logical_size() method, returns node size accounting for window scale

This commit is contained in:
Brandon S 2025-02-17 09:30:54 -05:00
parent 82f6f704da
commit 3751faedc4

View File

@ -118,6 +118,13 @@ impl ComputedNode {
self.unrounded_size
}
/// The calculate node size as width and height in physical pixels, accounting for a non-uniform window scale factor.
///
#[inline]
pub const fn logical_size(&self) -> Vec2 {
self.size * self.inverse_scale_factor
}
/// Returns the thickness of the UI node's outline in physical pixels.
/// If this value is negative or `0.` then no outline will be rendered.
///