From 0e56641b28ce5a598fe0253f1c76e9d763cd2c8a Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 4 Feb 2015 07:57:13 -0800 Subject: [PATCH] Update font constants --- src/Layout-test-utils.c | 4 +- src/Layout-test-utils.js | 4 +- src/__tests__/Layout-test.c | 46 +++++++++---------- src/__tests__/Layout-test.js | 8 ++-- .../facebook/csslayout/LayoutEngineTest.java | 46 +++++++++---------- .../com/facebook/csslayout/TestConstants.java | 4 +- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/Layout-test-utils.c b/src/Layout-test-utils.c index 5146443b..6eb6c18f 100644 --- a/src/Layout-test-utils.c +++ b/src/Layout-test-utils.c @@ -12,9 +12,9 @@ /** START_GENERATED **/ #define SMALL_WIDTH 34.671875 -#define SMALL_HEIGHT 18 +#define SMALL_HEIGHT 16 #define BIG_WIDTH 172.421875 -#define BIG_HEIGHT 36 +#define BIG_HEIGHT 32 #define BIG_MIN_WIDTH 100.453125 #define SMALL_TEXT "small" #define LONG_TEXT "loooooooooong with space" diff --git a/src/Layout-test-utils.js b/src/Layout-test-utils.js index 6ce62717..c85acf21 100644 --- a/src/Layout-test-utils.js +++ b/src/Layout-test-utils.js @@ -358,9 +358,9 @@ var layoutTestUtils = (function() { var preDefinedTextSizes = { smallWidth: 34.671875, - smallHeight: 18, + smallHeight: 16, bigWidth: 172.421875, - bigHeight: 36, + bigHeight: 32, bigMinWidth: 100.453125 }; diff --git a/src/__tests__/Layout-test.c b/src/__tests__/Layout-test.c index cae43486..888f6d90 100644 --- a/src/__tests__/Layout-test.c +++ b/src/__tests__/Layout-test.c @@ -2483,7 +2483,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 34.671875; - node_0->layout.dimensions[CSS_HEIGHT] = 18; + node_0->layout.dimensions[CSS_HEIGHT] = 16; } test("should layout node with just text", root_node, root_layout); @@ -2504,7 +2504,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 10; - node_0->layout.dimensions[CSS_HEIGHT] = 18; + node_0->layout.dimensions[CSS_HEIGHT] = 16; } test("should layout node with text and width", root_node, root_layout); @@ -2524,7 +2524,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 172.421875; - node_0->layout.dimensions[CSS_HEIGHT] = 18; + node_0->layout.dimensions[CSS_HEIGHT] = 16; } test("should layout node with text, padding and margin", root_node, root_layout); @@ -2606,7 +2606,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 500; - node_0->layout.dimensions[CSS_HEIGHT] = 18; + node_0->layout.dimensions[CSS_HEIGHT] = 16; init_css_node_children(node_0, 1); { css_node_t *node_1; @@ -2614,7 +2614,7 @@ int main() node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 500; - node_1->layout.dimensions[CSS_HEIGHT] = 18; + node_1->layout.dimensions[CSS_HEIGHT] = 16; init_css_node_children(node_1, 1); { css_node_t *node_2; @@ -2622,7 +2622,7 @@ int main() node_2->layout.position[CSS_TOP] = 0; node_2->layout.position[CSS_LEFT] = 0; node_2->layout.dimensions[CSS_WIDTH] = 500; - node_2->layout.dimensions[CSS_HEIGHT] = 18; + node_2->layout.dimensions[CSS_HEIGHT] = 16; } } } @@ -2657,7 +2657,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 130; - node_0->layout.dimensions[CSS_HEIGHT] = 36; + node_0->layout.dimensions[CSS_HEIGHT] = 32; init_css_node_children(node_0, 1); { css_node_t *node_1; @@ -2665,7 +2665,7 @@ int main() node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 130; - node_1->layout.dimensions[CSS_HEIGHT] = 36; + node_1->layout.dimensions[CSS_HEIGHT] = 32; init_css_node_children(node_1, 1); { css_node_t *node_2; @@ -2673,7 +2673,7 @@ int main() node_2->layout.position[CSS_TOP] = 0; node_2->layout.position[CSS_LEFT] = 0; node_2->layout.dimensions[CSS_WIDTH] = 130; - node_2->layout.dimensions[CSS_HEIGHT] = 36; + node_2->layout.dimensions[CSS_HEIGHT] = 32; } } } @@ -2709,7 +2709,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 200; - node_0->layout.dimensions[CSS_HEIGHT] = 36; + node_0->layout.dimensions[CSS_HEIGHT] = 32; init_css_node_children(node_0, 1); { css_node_t *node_1; @@ -2717,7 +2717,7 @@ int main() node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 200; - node_1->layout.dimensions[CSS_HEIGHT] = 36; + node_1->layout.dimensions[CSS_HEIGHT] = 32; init_css_node_children(node_1, 1); { css_node_t *node_2; @@ -2725,7 +2725,7 @@ int main() node_2->layout.position[CSS_TOP] = 0; node_2->layout.position[CSS_LEFT] = 0; node_2->layout.dimensions[CSS_WIDTH] = 130; - node_2->layout.dimensions[CSS_HEIGHT] = 36; + node_2->layout.dimensions[CSS_HEIGHT] = 32; } } } @@ -2755,7 +2755,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 100; - node_0->layout.dimensions[CSS_HEIGHT] = 36; + node_0->layout.dimensions[CSS_HEIGHT] = 32; init_css_node_children(node_0, 1); { css_node_t *node_1; @@ -2763,7 +2763,7 @@ int main() node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 100.453125; - node_1->layout.dimensions[CSS_HEIGHT] = 36; + node_1->layout.dimensions[CSS_HEIGHT] = 32; } } @@ -2805,7 +2805,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 100; - node_0->layout.dimensions[CSS_HEIGHT] = 76; + node_0->layout.dimensions[CSS_HEIGHT] = 72; init_css_node_children(node_0, 1); { css_node_t *node_1; @@ -2813,7 +2813,7 @@ int main() node_1->layout.position[CSS_TOP] = 20; node_1->layout.position[CSS_LEFT] = 20; node_1->layout.dimensions[CSS_WIDTH] = 100.453125; - node_1->layout.dimensions[CSS_HEIGHT] = 36; + node_1->layout.dimensions[CSS_HEIGHT] = 32; init_css_node_children(node_1, 1); { css_node_t *node_2; @@ -2821,7 +2821,7 @@ int main() node_2->layout.position[CSS_TOP] = 0; node_2->layout.position[CSS_LEFT] = 0; node_2->layout.dimensions[CSS_WIDTH] = 100.453125; - node_2->layout.dimensions[CSS_HEIGHT] = 36; + node_2->layout.dimensions[CSS_HEIGHT] = 32; } } } @@ -2936,7 +2936,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 200; - node_0->layout.dimensions[CSS_HEIGHT] = 58; + node_0->layout.dimensions[CSS_HEIGHT] = 56; init_css_node_children(node_0, 1); { css_node_t *node_1; @@ -2944,7 +2944,7 @@ int main() node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 200; - node_1->layout.dimensions[CSS_HEIGHT] = 58; + node_1->layout.dimensions[CSS_HEIGHT] = 56; init_css_node_children(node_1, 1); { css_node_t *node_2; @@ -2952,7 +2952,7 @@ int main() node_2->layout.position[CSS_TOP] = 20; node_2->layout.position[CSS_LEFT] = 20; node_2->layout.dimensions[CSS_WIDTH] = 172.421875; - node_2->layout.dimensions[CSS_HEIGHT] = 18; + node_2->layout.dimensions[CSS_HEIGHT] = 16; } } } @@ -2989,7 +2989,7 @@ int main() node_0->layout.position[CSS_TOP] = 0; node_0->layout.position[CSS_LEFT] = 0; node_0->layout.dimensions[CSS_WIDTH] = 200; - node_0->layout.dimensions[CSS_HEIGHT] = 76; + node_0->layout.dimensions[CSS_HEIGHT] = 72; init_css_node_children(node_0, 1); { css_node_t *node_1; @@ -2997,7 +2997,7 @@ int main() node_1->layout.position[CSS_TOP] = 0; node_1->layout.position[CSS_LEFT] = 0; node_1->layout.dimensions[CSS_WIDTH] = 200; - node_1->layout.dimensions[CSS_HEIGHT] = 76; + node_1->layout.dimensions[CSS_HEIGHT] = 72; init_css_node_children(node_1, 1); { css_node_t *node_2; @@ -3005,7 +3005,7 @@ int main() node_2->layout.position[CSS_TOP] = 20; node_2->layout.position[CSS_LEFT] = 20; node_2->layout.dimensions[CSS_WIDTH] = 160; - node_2->layout.dimensions[CSS_HEIGHT] = 36; + node_2->layout.dimensions[CSS_HEIGHT] = 32; } } } diff --git a/src/__tests__/Layout-test.js b/src/__tests__/Layout-test.js index 5057c2aa..f8543322 100755 --- a/src/__tests__/Layout-test.js +++ b/src/__tests__/Layout-test.js @@ -890,8 +890,8 @@ describe('Layout', function() { {style: {margin: 20, measure: text(texts.big)}} ]} ]}, - {width: 200, height: 58, top: 0, left: 0, children: [ - {width: 200, height: 58, top: 0, left: 0, children: [ + {width: 200, height: textSizes.smallHeight + 40, top: 0, left: 0, children: [ + {width: 200, height: textSizes.smallHeight + 40, top: 0, left: 0, children: [ {width: textSizes.bigWidth, height: textSizes.smallHeight, top: 20, left: 20} ]} ]} @@ -905,8 +905,8 @@ describe('Layout', function() { {style: {margin: 20, measure: text(texts.big)}} ]} ]}, - {width: 200, height: 76, top: 0, left: 0, children: [ - {width: 200, height: 76, top: 0, left: 0, children: [ + {width: 200, height: textSizes.bigHeight + 40, top: 0, left: 0, children: [ + {width: 200, height: textSizes.bigHeight + 40, top: 0, left: 0, children: [ {width: 160, height: textSizes.bigHeight, top: 20, left: 20} ]} ]} diff --git a/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java b/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java index b7135f62..b34ee12d 100644 --- a/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java +++ b/src/java/tests/com/facebook/csslayout/LayoutEngineTest.java @@ -2685,7 +2685,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 34.671875f; - node_0.layout.height = 18; + node_0.layout.height = 16; } test("should layout node with just text", root_node, root_layout); @@ -2708,7 +2708,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 10; - node_0.layout.height = 18; + node_0.layout.height = 16; } test("should layout node with text and width", root_node, root_layout); @@ -2730,7 +2730,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 172.421875f; - node_0.layout.height = 18; + node_0.layout.height = 16; } test("should layout node with text, padding and margin", root_node, root_layout); @@ -2816,7 +2816,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 500; - node_0.layout.height = 18; + node_0.layout.height = 16; addChildren(node_0, 1); { TestCSSNode node_1; @@ -2824,7 +2824,7 @@ public class LayoutEngineTest { node_1.layout.y = 0; node_1.layout.x = 0; node_1.layout.width = 500; - node_1.layout.height = 18; + node_1.layout.height = 16; addChildren(node_1, 1); { TestCSSNode node_2; @@ -2832,7 +2832,7 @@ public class LayoutEngineTest { node_2.layout.y = 0; node_2.layout.x = 0; node_2.layout.width = 500; - node_2.layout.height = 18; + node_2.layout.height = 16; } } } @@ -2869,7 +2869,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 130; - node_0.layout.height = 36; + node_0.layout.height = 32; addChildren(node_0, 1); { TestCSSNode node_1; @@ -2877,7 +2877,7 @@ public class LayoutEngineTest { node_1.layout.y = 0; node_1.layout.x = 0; node_1.layout.width = 130; - node_1.layout.height = 36; + node_1.layout.height = 32; addChildren(node_1, 1); { TestCSSNode node_2; @@ -2885,7 +2885,7 @@ public class LayoutEngineTest { node_2.layout.y = 0; node_2.layout.x = 0; node_2.layout.width = 130; - node_2.layout.height = 36; + node_2.layout.height = 32; } } } @@ -2923,7 +2923,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 200; - node_0.layout.height = 36; + node_0.layout.height = 32; addChildren(node_0, 1); { TestCSSNode node_1; @@ -2931,7 +2931,7 @@ public class LayoutEngineTest { node_1.layout.y = 0; node_1.layout.x = 0; node_1.layout.width = 200; - node_1.layout.height = 36; + node_1.layout.height = 32; addChildren(node_1, 1); { TestCSSNode node_2; @@ -2939,7 +2939,7 @@ public class LayoutEngineTest { node_2.layout.y = 0; node_2.layout.x = 0; node_2.layout.width = 130; - node_2.layout.height = 36; + node_2.layout.height = 32; } } } @@ -2971,7 +2971,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 100; - node_0.layout.height = 36; + node_0.layout.height = 32; addChildren(node_0, 1); { TestCSSNode node_1; @@ -2979,7 +2979,7 @@ public class LayoutEngineTest { node_1.layout.y = 0; node_1.layout.x = 0; node_1.layout.width = 100.453125f; - node_1.layout.height = 36; + node_1.layout.height = 32; } } @@ -3023,7 +3023,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 100; - node_0.layout.height = 76; + node_0.layout.height = 72; addChildren(node_0, 1); { TestCSSNode node_1; @@ -3031,7 +3031,7 @@ public class LayoutEngineTest { node_1.layout.y = 20; node_1.layout.x = 20; node_1.layout.width = 100.453125f; - node_1.layout.height = 36; + node_1.layout.height = 32; addChildren(node_1, 1); { TestCSSNode node_2; @@ -3039,7 +3039,7 @@ public class LayoutEngineTest { node_2.layout.y = 0; node_2.layout.x = 0; node_2.layout.width = 100.453125f; - node_2.layout.height = 36; + node_2.layout.height = 32; } } } @@ -3160,7 +3160,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 200; - node_0.layout.height = 58; + node_0.layout.height = 56; addChildren(node_0, 1); { TestCSSNode node_1; @@ -3168,7 +3168,7 @@ public class LayoutEngineTest { node_1.layout.y = 0; node_1.layout.x = 0; node_1.layout.width = 200; - node_1.layout.height = 58; + node_1.layout.height = 56; addChildren(node_1, 1); { TestCSSNode node_2; @@ -3176,7 +3176,7 @@ public class LayoutEngineTest { node_2.layout.y = 20; node_2.layout.x = 20; node_2.layout.width = 172.421875f; - node_2.layout.height = 18; + node_2.layout.height = 16; } } } @@ -3215,7 +3215,7 @@ public class LayoutEngineTest { node_0.layout.y = 0; node_0.layout.x = 0; node_0.layout.width = 200; - node_0.layout.height = 76; + node_0.layout.height = 72; addChildren(node_0, 1); { TestCSSNode node_1; @@ -3223,7 +3223,7 @@ public class LayoutEngineTest { node_1.layout.y = 0; node_1.layout.x = 0; node_1.layout.width = 200; - node_1.layout.height = 76; + node_1.layout.height = 72; addChildren(node_1, 1); { TestCSSNode node_2; @@ -3231,7 +3231,7 @@ public class LayoutEngineTest { node_2.layout.y = 20; node_2.layout.x = 20; node_2.layout.width = 160; - node_2.layout.height = 36; + node_2.layout.height = 32; } } } diff --git a/src/java/tests/com/facebook/csslayout/TestConstants.java b/src/java/tests/com/facebook/csslayout/TestConstants.java index 2b450729..b3a99f06 100644 --- a/src/java/tests/com/facebook/csslayout/TestConstants.java +++ b/src/java/tests/com/facebook/csslayout/TestConstants.java @@ -15,9 +15,9 @@ public class TestConstants { /** START_GENERATED **/ public static final float SMALL_WIDTH = 34.671875f; - public static final float SMALL_HEIGHT = 18f; + public static final float SMALL_HEIGHT = 16f; public static final float BIG_WIDTH = 172.421875f; - public static final float BIG_HEIGHT = 36f; + public static final float BIG_HEIGHT = 32f; public static final float BIG_MIN_WIDTH = 100.453125f; public static final String SMALL_TEXT = "small"; public static final String LONG_TEXT = "loooooooooong with space";