Coordinate mapping for one strip orientation: a pure value type, trivially copyable, no allocation, cheap enough to read once per column and once per tile inside the relayout loop.
More...
|
| constexpr | StripAxis ()=default |
| constexpr | StripAxis (PhosphorProtocol::ScrollAxis axis) |
| constexpr PhosphorProtocol::ScrollAxis | axis () const |
| constexpr bool | isHorizontal () const |
| constexpr bool | isVertical () const |
| | The negative of isHorizontal, spelled out.
|
| constexpr StripAxis | transposed () const |
| | Main and cross exchanged.
|
| constexpr int | mainPos (const QRect &r) const |
| constexpr int | crossPos (const QRect &r) const |
| constexpr int | mainSize (const QRect &r) const |
| constexpr int | crossSize (const QRect &r) const |
| constexpr int | mainSize (const QSize &s) const |
| constexpr int | crossSize (const QSize &s) const |
| constexpr int | mainPos (const QPoint &p) const |
| constexpr int | crossPos (const QPoint &p) const |
| constexpr int | mainLow (const QRect &r) const |
| | Inclusive low / high edges, matching QRect's own semantics where right() and bottom() are the LAST CONTAINED pixel rather than one past.
|
| constexpr int | mainHigh (const QRect &r) const |
| constexpr int | crossLow (const QRect &r) const |
| constexpr int | crossHigh (const QRect &r) const |
| constexpr QRect | makeRect (int mainPosition, int crossPosition, int mainExtent, int crossExtent) const |
| | Build a rect from role coordinates.
|
| constexpr void | setMainLow (QRect &r, int v) const |
| | setLeft/setTop equivalent: MOVES the low edge and HOLDS the high edge, so it changes both position and extent.
|
| constexpr void | setMainHigh (QRect &r, int v) const |
| constexpr void | setCrossHigh (QRect &r, int v) const |
| constexpr void | moveMain (QRect &r, int v) const |
| | Reposition without resizing, unlike the setters above.
|
| constexpr QRect | translatedMain (const QRect &r, int delta) const |
| | Translate along the MAIN axis only — the view slide.
|
| constexpr bool | operator== (const StripAxis &other) const |
| constexpr bool | operator!= (const StripAxis &other) const |
Coordinate mapping for one strip orientation: a pure value type, trivially copyable, no allocation, cheap enough to read once per column and once per tile inside the relayout loop.
Every accessor is named for the ROLE (main / cross), never the physical axis. MAIN is the strip — columns lie along it and the view scrolls along it. CROSS is the within-column stack. For Horizontal, main = x and cross = y, and every accessor below is the identity mapping, which is what makes the transposition rewrite land behaviour-preserving.
A call site that still needs a physical x or y is by definition NOT transposing and must say so in a comment. There are two legitimate cases: the park position (which means "off every output", a claim independent of strip direction) and the tab indicator's screen-edge vocabulary (a user who asked for an indicator on the left means the left of their screen).
THIS TYPE MAPS COORDINATES; IT NEVER INTERPRETS USER INTENT. The direction-token to role remap belongs with the navigation verbs, not here — geometry transposition and input-intent transposition are different problems and must not share an object.