Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::CellSize Struct Reference

An owning available extent in terminal columns/rows. More...

#include <geometry.hpp>

Public Member Functions

CellSize normalized () const noexcept
 Return an owning nonnegative extent; no errors or invalidation.
bool operator== (const CellSize &other) const noexcept=default
 Compare stored components; no normalization, errors or invalidation.

Public Attributes

std::int32_t width {}
 Available number of columns, possibly negative before normalization.
std::int32_t height {}
 Available number of rows, possibly negative before normalization.

Detailed Description

An owning available extent in terminal columns/rows.

Signed inputs may be negative; normalized() clamps each negative component to zero. No implicit Canvas/GUI conversion exists. Values have independent lifetime, no thread affinity and no invalidation. Shared mutation requires synchronization.

Member Function Documentation

◆ normalized()

CellSize portals::CellSize::normalized ( ) const
nodiscardnoexcept

Return an owning nonnegative extent; no errors or invalidation.

Returns
A copy with each negative extent replaced by zero.

◆ operator==()

bool portals::CellSize::operator== ( const CellSize & other) const
defaultnoexcept

Compare stored components; no normalization, errors or invalidation.

Parameters
otherValue whose corresponding fields are compared.
Returns
True when every compared field is equal; false otherwise.

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