Skip to content

ui::Size

Header: winui/core/Geometry.hpp.

A width/height pair in DIPs: what Element::measure() returns and takes as available.

In a measure offer, ui::Unbounded (+infinity) on an axis means unbounded; 0 is no room.

Example:

ui::ButtonControl button{"Save"};
const ui::Size    desired = button.measure(ui::Size{300, ui::Unbounded}, measurer, theme);
REQUIRE_FALSE(desired.empty());

width

float width = 0.0f

Horizontal extent, DIPs.

height

float height = 0.0f

Vertical extent, DIPs.

empty

bool empty() const

True if either extent is zero or negative, i.e. the size covers no area.