2#include "TinyMaterialDesign/Core/Bounds.h"
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
25 : container_(container), spacing_(spacing) {
32 if (cursorX_ != container_
.x && cursorX_ + width > container_
.right()) {
33 cursorX_ = container_
.x;
34 cursorY_ += rowHeight_ + spacing_;
37 const Bounds rect
(cursorX_
, cursorY_
, width
, height
);
38 cursorX_ += width + spacing_;
39 if (height > rowHeight_) rowHeight_ = height;
45 cursorX_ = container_
.x;
46 cursorY_ = container_
.y;
51 int32_t
totalHeight()
const {
return (cursorY_ - container_
.y) + rowHeight_; }
58 int32_t rowHeight_ = 0;
Computes wrapping rects for items of varying width (chip/tag rows).
Definition: FlowLayout.h:22
Bounds next(int32_t width, int32_t height)
Definition: FlowLayout.h:31
FlowLayout(Bounds container, int32_t spacing=8)
Definition: FlowLayout.h:24
int32_t totalHeight() const
Total height consumed by items placed since the last reset().
Definition: FlowLayout.h:51
void reset()
Restarts packing from the container's top-left corner.
Definition: FlowLayout.h:44
Definition: AnchorLayout.h:4
Axis-aligned pixel rectangle used for widget bounds and hit-testing.
Definition: Bounds.h:21
int32_t right() const
Definition: Bounds.h:30
Bounds(int32_t x, int32_t y, int32_t w, int32_t h)
Definition: Bounds.h:28
int32_t y
Definition: Bounds.h:23
int32_t x
Definition: Bounds.h:22