Added isVisible flag and getter / setter.
This commit is contained in:
@@ -89,6 +89,7 @@ typedef struct CSSNode {
|
|||||||
CSSNodeRef parent;
|
CSSNodeRef parent;
|
||||||
CSSNodeListRef children;
|
CSSNodeListRef children;
|
||||||
bool isDirty;
|
bool isDirty;
|
||||||
|
bool isVisible;
|
||||||
|
|
||||||
struct CSSNode *nextChild;
|
struct CSSNode *nextChild;
|
||||||
|
|
||||||
@@ -198,6 +199,7 @@ void CSSNodeInit(const CSSNodeRef node) {
|
|||||||
node->children = NULL;
|
node->children = NULL;
|
||||||
node->hasNewLayout = true;
|
node->hasNewLayout = true;
|
||||||
node->isDirty = false;
|
node->isDirty = false;
|
||||||
|
node->isVisible = true;
|
||||||
|
|
||||||
node->style.flex = CSSUndefined;
|
node->style.flex = CSSUndefined;
|
||||||
node->style.flexGrow = CSSUndefined;
|
node->style.flexGrow = CSSUndefined;
|
||||||
@@ -287,6 +289,14 @@ bool CSSNodeIsDirty(const CSSNodeRef node) {
|
|||||||
return node->isDirty;
|
return node->isDirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSSNodeHide(const CSSNodeRef node) {
|
||||||
|
node->isVisible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSSNodeShow(const CSSNodeRef node) {
|
||||||
|
node->isVisible = true;;
|
||||||
|
}
|
||||||
|
|
||||||
inline float CSSNodeStyleGetFlexGrow(CSSNodeRef node) {
|
inline float CSSNodeStyleGetFlexGrow(CSSNodeRef node) {
|
||||||
if (!CSSValueIsUndefined(node->style.flexGrow)) {
|
if (!CSSValueIsUndefined(node->style.flexGrow)) {
|
||||||
return node->style.flexGrow;
|
return node->style.flexGrow;
|
||||||
@@ -1190,6 +1200,7 @@ static void layoutNodeImpl(const CSSNodeRef node,
|
|||||||
const CSSMeasureMode widthMeasureMode,
|
const CSSMeasureMode widthMeasureMode,
|
||||||
const CSSMeasureMode heightMeasureMode,
|
const CSSMeasureMode heightMeasureMode,
|
||||||
const bool performLayout) {
|
const bool performLayout) {
|
||||||
|
|
||||||
CSS_ASSERT(CSSValueIsUndefined(availableWidth) ? widthMeasureMode == CSSMeasureModeUndefined
|
CSS_ASSERT(CSSValueIsUndefined(availableWidth) ? widthMeasureMode == CSSMeasureModeUndefined
|
||||||
: true,
|
: true,
|
||||||
"availableWidth is indefinite so widthMeasureMode must be "
|
"availableWidth is indefinite so widthMeasureMode must be "
|
||||||
|
@@ -157,6 +157,9 @@ WIN_EXPORT void CSSNodeCalculateLayout(const CSSNodeRef node,
|
|||||||
WIN_EXPORT void CSSNodeMarkDirty(const CSSNodeRef node);
|
WIN_EXPORT void CSSNodeMarkDirty(const CSSNodeRef node);
|
||||||
WIN_EXPORT bool CSSNodeIsDirty(const CSSNodeRef node);
|
WIN_EXPORT bool CSSNodeIsDirty(const CSSNodeRef node);
|
||||||
|
|
||||||
|
WIN_EXPORT void CSSNodeHide(const CSSNodeRef node);
|
||||||
|
WIN_EXPORT void CSSNodeShow(const CSSNodeRef node);
|
||||||
|
|
||||||
WIN_EXPORT void CSSNodePrint(const CSSNodeRef node, const CSSPrintOptions options);
|
WIN_EXPORT void CSSNodePrint(const CSSNodeRef node, const CSSPrintOptions options);
|
||||||
|
|
||||||
WIN_EXPORT bool CSSValueIsUndefined(const float value);
|
WIN_EXPORT bool CSSValueIsUndefined(const float value);
|
||||||
|
Reference in New Issue
Block a user