Skip to content

Commit c0f5f93

Browse files
committed
Test for baseline alignment
1 parent bf980a7 commit c0f5f93

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

lib/src/replaced_element.dart

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,22 @@ class MathElement extends ReplacedElement {
280280
if (element.localName == "math") {
281281
texStr = parseMathRecursive(element, r'');
282282
}
283-
return Container(
284-
width: MediaQuery.of(context.buildContext).size.width,
285-
child: Math.tex(
286-
texStr,
287-
onErrorFallback: (FlutterMathException e) {
288-
if (context.parser.onMathError != null) {
289-
return context.parser.onMathError!.call(texStr, e.message, e.messageWithType);
290-
} else {
291-
return Text(e.message);
292-
}
293-
},
294-
)
283+
return Padding(
284+
padding: const EdgeInsets.only(bottom: 3.5),
285+
child: Container(
286+
width: element.localName == "math" ?
287+
MediaQuery.of(context.buildContext).size.width : null,
288+
child: Math.tex(
289+
texStr,
290+
onErrorFallback: (FlutterMathException e) {
291+
if (context.parser.onMathError != null) {
292+
return context.parser.onMathError!.call(texStr, e.message, e.messageWithType);
293+
} else {
294+
return Text(e.message);
295+
}
296+
},
297+
)
298+
),
295299
);
296300
}
297301

0 commit comments

Comments
 (0)