TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::CssPx Struct Reference

A size in CSS px. More...

#include <gui_core/gui_units.h>

Public Member Functions

constexpr CssPx ()=default
constexpr CssPx (int32_t v)
 Implicit, so a plain int size is CSS px.
constexpr auto operator<=> (const CssPx &) const =default

Public Attributes

int32_t value = 0

Detailed Description

A size in CSS px.

Sizes in the API are CSS px: the library scales them by the UI scale, as it does the stylesheet's. Positions, and sizes the library measured or computed, are whole device pixels; so is every int2 and IntRect (positions, rects, extents).

LayoutOverride{}.Width(200)                 // 200 CSS px: 300 pixels at 150%
LayoutOverride{}.Width(Pixels{ measured })  // as is 

Constructor & Destructor Documentation

◆ CssPx() [1/2]

tachyon::CssPx::CssPx ( )
constexprdefault

◆ CssPx() [2/2]

tachyon::CssPx::CssPx ( int32_t v)
inlineconstexpr

Implicit, so a plain int size is CSS px.

Member Function Documentation

◆ operator<=>()

auto tachyon::CssPx::operator<=> ( const CssPx & ) const
constexprdefault

Member Data Documentation

◆ value

int32_t tachyon::CssPx::value = 0

The documentation for this struct was generated from the following file: