Skip to content

Commit

Permalink
fix incorrect color for \frac lines, \overline, \underline and \rule (#1
Browse files Browse the repository at this point in the history
)
  • Loading branch information
znjameswu committed Jul 24, 2020
1 parent 298283c commit 2958b72
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/src/ast/nodes/accent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class AccentNode extends SlotableNode {
child: Container(
width: constraints.minWidth,
height: defaultRuleThickness, // TODO minRuleThickness
color: Colors.black,
color: options.color,
),
);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ast/nodes/accent_under.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AccentUnderNode extends SlotableNode {
child: Container(
width: constraints.minWidth,
height: defaultRuleThickness, // TODO minRuleThickness
color: Colors.black,
color: options.color,
),
);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ast/nodes/frac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class FracLayoutDelegate extends IntrinsicLayoutDelegate<_FracPos> {
void additionalPaint(PaintingContext context, Offset offset) {
if (theta != 0) {
final paint = Paint()
..color = Colors.black
..color = options.color
..strokeWidth = theta;
context.canvas.drawLine(
Offset(0.5 * (width - barLength), height - a) + offset,
Expand Down
11 changes: 7 additions & 4 deletions lib/src/ast/nodes/space.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class SpaceNode extends LeafNode {
// For the sole purpose of \rule
final Measurement shift;
final bool noBreak;
final Color background;
final bool fill;
// final Color background;
final Mode mode;

final bool alignerOrSpacer;
Expand All @@ -26,7 +27,8 @@ class SpaceNode extends LeafNode {
this.shift = Measurement.zero,
this.depth = Measurement.zero,
this.noBreak = false,
this.background,
this.fill = false,
// this.background,
@required this.mode,
this.alignerOrSpacer = false,
});
Expand All @@ -37,7 +39,8 @@ class SpaceNode extends LeafNode {
shift = Measurement.zero,
depth = Measurement.zero,
noBreak = false,
background = null,
fill = true,
// background = null,
mode = Mode.math,
alignerOrSpacer = true;

Expand Down Expand Up @@ -66,7 +69,7 @@ class SpaceNode extends LeafNode {
widget: ResetBaseline(
height: topMost,
child: Container(
color: background,
color: fill ? options.color : null,
height: topMost - bottomMost,
width: math.max(0.0, width),
),
Expand Down
3 changes: 2 additions & 1 deletion lib/src/parser/tex/functions/katex_base/rule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ GreenNode _ruleHandler(TexParser parser, FunctionContext context) {
height: height,
width: width,
shift: shift,
background: Colors.black,
fill: true,
// background: Colors.black,
mode: Mode.math,
);
}

0 comments on commit 2958b72

Please sign in to comment.