Example #1
0
 void printEdges(Node node, string str, Value[] edges)
 {
     if (fourValuesEqual(edges))
     {
         printNumberIfNotZero(node, str, edges[(int)Edge.Left]);
         // bugfix for issue #5
         // if we set EdgeAll, the values are
         // [{NaN 0} {NaN 0} {NaN 0} {NaN 0} {NaN 0} {NaN 0} {NaN 0} {NaN 0} {20 1}]
         // so EdgeLeft is not printed and we won't print padding
         // for simplicity, I assume that EdgeAll is exclusive with setting specific edges
         // so we can print both and only one should show up
         // C code has this bug: https://github.com/facebook/yoga/blob/26481a6553a33d9c005f2b8d24a7952fc58df32c/yoga/Yoga.c#L1036
         printNumberIfNotZero(node, str, edges[(int)Edge.All]);
     }
     else
     {
         for (var edge = (int)Edge.Left; edge < Constant.EdgeCount; edge++)
         {
             var buf = $"{str}-{Flex.EdgeToString((Edge)edge)}";
             printNumberIfNotZero(node, buf, edges[edge]);
         }
     }
 }