Check layout instead of style before setting height and width to whatever is set in layout

This commit is contained in:
Emil Sjolander
2016-01-05 19:33:04 +00:00
parent 219bdaed15
commit c9094f94d0
15 changed files with 331 additions and 76 deletions

View File

@@ -34,6 +34,7 @@ __forceinline const float fminf(const float a, const float b) {
#define SMALL_TEXT "small"
#define LONG_TEXT "loooooooooong with space"
#define MEASURE_WITH_RATIO_2 "measureWithRatio2"
#define MEASURE_WITH_MATCH_PARENT "measureWithMatchParent"
/** END_GENERATED **/
typedef struct failed_test_t {
@@ -115,6 +116,12 @@ css_dim_t measure(void *context, float width, float height) {
return dim;
}
if (strcmp(text, MEASURE_WITH_MATCH_PARENT) == 0) {
dim.dimensions[CSS_WIDTH] = width;
dim.dimensions[CSS_HEIGHT] = height;
return dim;
}
// Should not go here
dim.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
dim.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;