Baseline support #317

Closed
woehrl01 wants to merge 33 commits from baseline-support into master
16 changed files with 1024 additions and 3 deletions
Showing only changes of commit 29bce98fd9 - Show all commits

View File

@@ -16,5 +16,6 @@ namespace Facebook.Yoga
Center,
FlexEnd,
Stretch,
Baseline,
}
}

View File

@@ -100,7 +100,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
YGAlignFlexEnd:{value:'YogaAlign.FLEX_END'},
YGAlignFlexStart:{value:'YogaAlign.FLEX_START'},
YGAlignStretch:{value:'YogaAlign.STRETCH'},
YGAlignBaseline:{value:'YogaAlign.Baseline'},
YGAlignBaseline:{value:'YogaAlign.BASELINE'},
YGDirectionInherit:{value:'YogaDirection.INHERIT'},
YGDirectionLTR:{value:'YogaDirection.LTR'},

View File

@@ -17,7 +17,8 @@ public enum YogaAlign {
FLEX_START(1),
CENTER(2),
FLEX_END(3),
STRETCH(4);
STRETCH(4),
BASELINE(5);
private int mIntValue;
@@ -36,6 +37,7 @@ public enum YogaAlign {
case 2: return CENTER;
case 3: return FLEX_END;
case 4: return STRETCH;
case 5: return BASELINE;
default: throw new IllegalArgumentException("Unkown enum value: " + value);
}
}

View File

@@ -20,7 +20,7 @@ public class YGAlignBaseline {
public void test_align_baseline() {
final YogaNode root = new YogaNode();
root.setFlexDirection(YogaFlexDirection.ROW);
root.setAlignItems(YogaAlign.Baseline);
root.setAlignItems(YogaAlign.BASELINE);
root.setWidth(100f);
root.setHeight(100f);
@@ -74,7 +74,7 @@ public class YGAlignBaseline {
public void test_align_baseline_child() {
final YogaNode root = new YogaNode();
root.setFlexDirection(YogaFlexDirection.ROW);
root.setAlignItems(YogaAlign.Baseline);
root.setAlignItems(YogaAlign.BASELINE);
root.setWidth(100f);
root.setHeight(100f);
@@ -143,7 +143,7 @@ public class YGAlignBaseline {
public void test_align_baseline_double_nested_child() {
final YogaNode root = new YogaNode();
root.setFlexDirection(YogaFlexDirection.ROW);
root.setAlignItems(YogaAlign.Baseline);
root.setAlignItems(YogaAlign.BASELINE);
root.setWidth(100f);
root.setHeight(100f);
@@ -226,7 +226,7 @@ public class YGAlignBaseline {
@Test
public void test_align_baseline_column() {
final YogaNode root = new YogaNode();
root.setAlignItems(YogaAlign.Baseline);
root.setAlignItems(YogaAlign.BASELINE);
root.setWidth(100f);
root.setHeight(100f);