From 0d71ba17acbb315f7dc40c6887d3a079a338e7ed Mon Sep 17 00:00:00 2001 From: acton393 Date: Sun, 10 Nov 2019 23:43:35 +0800 Subject: [PATCH 1/2] add print yoga node AllEdge value when debug mode, the old logic just print four edgeValue including top left bottom and right, but when we set the same value to these edge, we use YGAllEdge, this will be more convenient debug code --- yoga/YGNodePrint.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yoga/YGNodePrint.cpp b/yoga/YGNodePrint.cpp index 6149cf53..57dbabd4 100644 --- a/yoga/YGNodePrint.cpp +++ b/yoga/YGNodePrint.cpp @@ -90,7 +90,11 @@ static void appendEdges( const string& key, const YGStyle::Edges& edges) { if (areFourValuesEqual(edges)) { - appendNumberIfNotZero(base, key, edges[YGEdgeLeft]); + YGEdge edge = YGEdgeLeft; + if (edges[edge].isUndefined()) { + edge = YGEdgeAll; + } + appendNumberIfNotZero(base, key, edges[edge]); } else { for (int edge = YGEdgeLeft; edge != YGEdgeAll; ++edge) { string str = key + "-" + YGEdgeToString(static_cast(edge)); -- 2.50.1.windows.1 From e71ce2fd62c05f7f33327fcc571de642b0d49eca Mon Sep 17 00:00:00 2001 From: acton393 Date: Sat, 18 Feb 2023 22:04:46 +0800 Subject: [PATCH 2/2] use computeEdgeValueForColumn value to obtain allEge value --- yoga/YGNodePrint.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/yoga/YGNodePrint.cpp b/yoga/YGNodePrint.cpp index 57dbabd4..da380e28 100644 --- a/yoga/YGNodePrint.cpp +++ b/yoga/YGNodePrint.cpp @@ -90,11 +90,8 @@ static void appendEdges( const string& key, const YGStyle::Edges& edges) { if (areFourValuesEqual(edges)) { - YGEdge edge = YGEdgeLeft; - if (edges[edge].isUndefined()) { - edge = YGEdgeAll; - } - appendNumberIfNotZero(base, key, edges[edge]); + auto edgeValue = YGNode::computeEdgeValueForColumn(edges, YGEdgeLeft, detail::CompactValue::ofZero()); + appendNumberIfNotZero(base, key, edgeValue); } else { for (int edge = YGEdgeLeft; edge != YGEdgeAll; ++edge) { string str = key + "-" + YGEdgeToString(static_cast(edge)); -- 2.50.1.windows.1