ui::Point¶
Header: winui/core/Geometry.hpp.
A 2D position in device-independent pixels (DIPs, 1/96 inch), y pointing down.
Used for pointer positions, rect origins and path vertices; coordinates are relative to whatever the API says (usually the window client area).
Example:
// In an element of your own: is the pointer over the close glyph?
class CardControl : public ui::Element
{
protected:
bool pointer_override(const ui::PointerEvent& e) override
{
const ui::Point corner{bounds().right() - 24.0f, bounds().y};
close_hot_ = ui::Rect{corner.x, corner.y, 24.0f, 24.0f}.contains(e.position);
return false;
}
private:
bool close_hot_ = false;
};
| Field | Type | Default | |
|---|---|---|---|
x |
float |
0.0f |
Horizontal coordinate, DIPs. |
y |
float |
0.0f |
Vertical coordinate, DIPs (down is positive). |