Baseline support #317
@@ -16,5 +16,6 @@ namespace Facebook.Yoga
|
|||||||
Center,
|
Center,
|
||||||
FlexEnd,
|
FlexEnd,
|
||||||
Stretch,
|
Stretch,
|
||||||
|
Baseline,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -100,7 +100,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
YGAlignFlexEnd:{value:'YogaAlign.FLEX_END'},
|
YGAlignFlexEnd:{value:'YogaAlign.FLEX_END'},
|
||||||
YGAlignFlexStart:{value:'YogaAlign.FLEX_START'},
|
YGAlignFlexStart:{value:'YogaAlign.FLEX_START'},
|
||||||
YGAlignStretch:{value:'YogaAlign.STRETCH'},
|
YGAlignStretch:{value:'YogaAlign.STRETCH'},
|
||||||
YGAlignBaseline:{value:'YogaAlign.Baseline'},
|
YGAlignBaseline:{value:'YogaAlign.BASELINE'},
|
||||||
|
|
||||||
YGDirectionInherit:{value:'YogaDirection.INHERIT'},
|
YGDirectionInherit:{value:'YogaDirection.INHERIT'},
|
||||||
YGDirectionLTR:{value:'YogaDirection.LTR'},
|
YGDirectionLTR:{value:'YogaDirection.LTR'},
|
||||||
|
@@ -17,7 +17,8 @@ public enum YogaAlign {
|
|||||||
FLEX_START(1),
|
FLEX_START(1),
|
||||||
CENTER(2),
|
CENTER(2),
|
||||||
FLEX_END(3),
|
FLEX_END(3),
|
||||||
STRETCH(4);
|
STRETCH(4),
|
||||||
|
BASELINE(5);
|
||||||
|
|
||||||
private int mIntValue;
|
private int mIntValue;
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@ public enum YogaAlign {
|
|||||||
case 2: return CENTER;
|
case 2: return CENTER;
|
||||||
case 3: return FLEX_END;
|
case 3: return FLEX_END;
|
||||||
case 4: return STRETCH;
|
case 4: return STRETCH;
|
||||||
|
case 5: return BASELINE;
|
||||||
default: throw new IllegalArgumentException("Unkown enum value: " + value);
|
default: throw new IllegalArgumentException("Unkown enum value: " + value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ public class YGAlignBaseline {
|
|||||||
public void test_align_baseline() {
|
public void test_align_baseline() {
|
||||||
final YogaNode root = new YogaNode();
|
final YogaNode root = new YogaNode();
|
||||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||||
root.setAlignItems(YogaAlign.Baseline);
|
root.setAlignItems(YogaAlign.BASELINE);
|
||||||
root.setWidth(100f);
|
root.setWidth(100f);
|
||||||
root.setHeight(100f);
|
root.setHeight(100f);
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public class YGAlignBaseline {
|
|||||||
public void test_align_baseline_child() {
|
public void test_align_baseline_child() {
|
||||||
final YogaNode root = new YogaNode();
|
final YogaNode root = new YogaNode();
|
||||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||||
root.setAlignItems(YogaAlign.Baseline);
|
root.setAlignItems(YogaAlign.BASELINE);
|
||||||
root.setWidth(100f);
|
root.setWidth(100f);
|
||||||
root.setHeight(100f);
|
root.setHeight(100f);
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ public class YGAlignBaseline {
|
|||||||
public void test_align_baseline_double_nested_child() {
|
public void test_align_baseline_double_nested_child() {
|
||||||
final YogaNode root = new YogaNode();
|
final YogaNode root = new YogaNode();
|
||||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||||
root.setAlignItems(YogaAlign.Baseline);
|
root.setAlignItems(YogaAlign.BASELINE);
|
||||||
root.setWidth(100f);
|
root.setWidth(100f);
|
||||||
root.setHeight(100f);
|
root.setHeight(100f);
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ public class YGAlignBaseline {
|
|||||||
@Test
|
@Test
|
||||||
public void test_align_baseline_column() {
|
public void test_align_baseline_column() {
|
||||||
final YogaNode root = new YogaNode();
|
final YogaNode root = new YogaNode();
|
||||||
root.setAlignItems(YogaAlign.Baseline);
|
root.setAlignItems(YogaAlign.BASELINE);
|
||||||
root.setWidth(100f);
|
root.setWidth(100f);
|
||||||
root.setHeight(100f);
|
root.setHeight(100f);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user