Turn "Unit" label into "mUnit" label, to allow for compiling on other compilers aside from MSVC

This commit is contained in:
Filip Homolka
2021-07-25 20:17:20 +02:00
parent b391581feb
commit 51cd0b56ae
3 changed files with 29 additions and 29 deletions

View File

@@ -38,45 +38,45 @@ namespace Nuake
{
case PropType::HEIGHT:
{
style.Height.Unit = (Layout::Unit)(s.second.type);
style.Height.mUnit = (Layout::Unit)(s.second.type);
float value = s.second.value.Number;
style.Height.Value = value;
}
break;
case PropType::MIN_HEIGHT:
style.MinHeight.Unit = (Layout::Unit)s.second.type;
style.MinHeight.mUnit = (Layout::Unit)s.second.type;
style.MinHeight.Value = s.second.value.Number;
break;
case PropType::MAX_HEIGHT:
style.MaxHeight.Unit = (Layout::Unit)s.second.type;
style.MaxHeight.mUnit = (Layout::Unit)s.second.type;
style.MaxHeight.Value = s.second.value.Number;
break;
case PropType::WIDTH:
style.Width.Unit = (Layout::Unit)s.second.type;
style.Width.mUnit = (Layout::Unit)s.second.type;
style.Width.Value = s.second.value.Number;
break;
case PropType::MIN_WIDTH:
style.MinWidth.Unit = (Layout::Unit)s.second.type;
style.MinWidth.mUnit = (Layout::Unit)s.second.type;
style.MinWidth.Value = s.second.value.Number;
break;
case PropType::MAX_WIDTH:
style.MaxWidth.Unit = (Layout::Unit)s.second.type;
style.MaxWidth.mUnit = (Layout::Unit)s.second.type;
style.MaxWidth.Value = s.second.value.Number;
break;
case PropType::MARGIN_RIGHT:
style.Margin.Right.Unit = (Layout::Unit)s.second.type;
style.Margin.Right.mUnit = (Layout::Unit)s.second.type;
style.Margin.Right.Value = s.second.value.Number;
break;
case PropType::MARGIN_LEFT:
style.Margin.Left.Unit = (Layout::Unit)s.second.type;
style.Margin.Left.mUnit = (Layout::Unit)s.second.type;
style.Margin.Left.Value = s.second.value.Number;
break;
case PropType::MARGIN_TOP:
style.Margin.Top.Unit = (Layout::Unit)s.second.type;
style.Margin.Top.mUnit = (Layout::Unit)s.second.type;
style.Margin.Top.Value = s.second.value.Number;
break;
case PropType::MARGIN_BOTTOM:
style.Margin.Bottom.Unit = (Layout::Unit)s.second.type;
style.Margin.Bottom.mUnit = (Layout::Unit)s.second.type;
style.Margin.Bottom.Value = s.second.value.Number;
break;
case PropType::JUSTIFY_CONTENT:
@@ -101,19 +101,19 @@ namespace Nuake
style.PositionType = (Layout::PositionType)s.second.value.Enum;
break;
case PropType::LEFT:
style.Position.Left.Unit = (Layout::Unit)s.second.type;
style.Position.Left.mUnit = (Layout::Unit)s.second.type;
style.Position.Left.Value = s.second.value.Number;
break;
case PropType::RIGHT:
style.Position.Right.Unit = (Layout::Unit)s.second.type;
style.Position.Right.mUnit = (Layout::Unit)s.second.type;
style.Position.Right.Value = s.second.value.Number;
break;
case PropType::TOP:
style.Position.Top.Unit = (Layout::Unit)s.second.type;
style.Position.Top.mUnit = (Layout::Unit)s.second.type;
style.Position.Top.Value = s.second.value.Number;
break;
case PropType::BOTTOM:
style.Position.Bottom.Unit = (Layout::Unit)s.second.type;
style.Position.Bottom.mUnit = (Layout::Unit)s.second.type;
style.Position.Bottom.Value = s.second.value.Number;
break;
case PropType::BACKGROUND_COLOR:

View File

@@ -74,7 +74,7 @@ namespace Nuake
if (IsHover)
style = this->HoverStyle;
switch (style.Width.Unit)
switch (style.Width.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetWidth(YogaNode, style.Width.Value);
@@ -86,7 +86,7 @@ namespace Nuake
YGNodeStyleSetWidthAuto(YogaNode);
break;
}
switch (style.Height.Unit)
switch (style.Height.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetHeight(YogaNode, style.Height.Value);
@@ -99,7 +99,7 @@ namespace Nuake
break;
}
switch (style.Margin.Left.Unit)
switch (style.Margin.Left.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetMargin(YogaNode, YGEdgeLeft, style.Margin.Left.Value);
@@ -112,7 +112,7 @@ namespace Nuake
break;
}
switch (style.Margin.Right.Unit)
switch (style.Margin.Right.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetMargin(YogaNode, YGEdgeRight, style.Margin.Right.Value);
@@ -125,7 +125,7 @@ namespace Nuake
break;
}
switch (style.Margin.Top.Unit)
switch (style.Margin.Top.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetMargin(YogaNode, YGEdgeTop, style.Margin.Top.Value);
@@ -138,7 +138,7 @@ namespace Nuake
break;
}
switch (style.Margin.Bottom.Unit)
switch (style.Margin.Bottom.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetMargin(YogaNode, YGEdgeBottom, style.Margin.Bottom.Value);
@@ -150,7 +150,7 @@ namespace Nuake
YGNodeStyleSetMarginAuto(YogaNode, YGEdgeTop);
break;
}
switch (style.Padding.Left.Unit)
switch (style.Padding.Left.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetPadding(YogaNode, YGEdgeLeft, style.Padding.Left.Value);
@@ -160,7 +160,7 @@ namespace Nuake
break;
}
switch (style.Padding.Right.Unit)
switch (style.Padding.Right.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetPadding(YogaNode, YGEdgeRight, style.Padding.Right.Value);
@@ -170,7 +170,7 @@ namespace Nuake
break;
}
switch (style.Padding.Top.Unit)
switch (style.Padding.Top.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetPadding(YogaNode, YGEdgeTop, style.Padding.Top.Value);
@@ -180,7 +180,7 @@ namespace Nuake
break;
}
switch (style.Padding.Bottom.Unit)
switch (style.Padding.Bottom.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetPadding(YogaNode, YGEdgeBottom, style.Padding.Bottom.Value);
@@ -189,28 +189,28 @@ namespace Nuake
YGNodeStyleSetPaddingPercent(YogaNode, YGEdgeBottom, style.Padding.Bottom.Value);
break;
}
switch (style.Border.Left.Unit)
switch (style.Border.Left.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetBorder(YogaNode, YGEdgeLeft, style.Border.Left.Value);
break;
}
switch (style.Border.Right.Unit)
switch (style.Border.Right.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetBorder(YogaNode, YGEdgeRight, style.Border.Right.Value);
break;
}
switch (style.Border.Top.Unit)
switch (style.Border.Top.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetBorder(YogaNode, YGEdgeTop, style.Border.Top.Value);
break;
}
switch (style.Border.Bottom.Unit)
switch (style.Border.Bottom.mUnit)
{
case Layout::Unit::PIXEL:
YGNodeStyleSetBorder(YogaNode, YGEdgeBottom, style.Border.Bottom.Value);

View File

@@ -49,7 +49,7 @@ namespace Nuake
struct LayoutUnit
{
float Value = 0.0f;
Unit Unit = Unit::PIXEL;
Unit mUnit = Unit::PIXEL;
};
struct LayoutVec4