File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -756,20 +756,13 @@ class HtmlParser extends StatelessWidget {
756756 tree.children[i - 1 ].style.margin? .bottom? .value ?? 0 ;
757757 final thisTop = tree.children[i].style.margin? .top? .value ?? 0 ;
758758 final newInternalMargin = max (previousSiblingBottom, thisTop);
759-
760- if (tree.children[i - 1 ].style.margin == null ) {
761- tree.children[i - 1 ].style.margin =
762- Margins .only (bottom: newInternalMargin);
763- } else {
764- tree.children[i - 1 ].style.margin = tree.children[i - 1 ].style.margin!
765- .copyWithEdge (bottom: newInternalMargin);
766- }
759+ final newTop = newInternalMargin - previousSiblingBottom;
767760
768761 if (tree.children[i].style.margin == null ) {
769- tree.children[i].style.margin = Margins .only (top: newInternalMargin );
762+ tree.children[i].style.margin = Margins .only (top: newTop );
770763 } else {
771- tree.children[i].style.margin = tree.children[i].style.margin !
772- . copyWithEdge (top: newInternalMargin );
764+ tree.children[i].style.margin =
765+ tree.children[i].style.margin ! . copyWithEdge (top: newTop );
773766 }
774767 }
775768 }
You can’t perform that action at this time.
0 commit comments