14#include "IGraphicsStructs.h"
17BEGIN_IGRAPHICS_NAMESPACE
35 void Init(
const IRECT& r, YGFlexDirection direction = YGFlexDirectionRow, YGJustify justify = YGJustifyFlexStart, YGWrap wrap = YGWrapNoWrap,
float padding = 0.f,
float margin = 0.f);
45 YGNodeRef
AddItem(
float width,
float height, YGAlign alignSelf = YGAlignAuto,
float grow = 0.f,
float shrink = 1.f,
float margin = 0.f);
53 void CalcLayout(YGDirection direction = YGDirectionLTR);
63 YGConfigRef mConfigRef;
64 YGNodeRef mRootNodeRef;
68END_IGRAPHICS_NAMESPACE
IFlexBox is a basic C++ helper for Yoga https://yogalayout.com.
YGNodeRef AddItem(float width, float height, YGAlign alignSelf=YGAlignAuto, float grow=0.f, float shrink=1.f, float margin=0.f)
Add a flex item, with some parameters.
void CalcLayout(YGDirection direction=YGDirectionLTR)
Calculate the layout, call after add all items.
IRECT GetItemBounds(int nodeIndex) const
Get the bounds for a particular flex item.
void Init(const IRECT &r, YGFlexDirection direction=YGFlexDirectionRow, YGJustify justify=YGJustifyFlexStart, YGWrap wrap=YGWrapNoWrap, float padding=0.f, float margin=0.f)
Initialize the IFlexBox flex container.
IRECT GetRootBounds() const
Get an IRECT of the root node bounds.
Used to manage a rectangular area, independent of draw class/platform.