From ce5fdeb24b01f6678e0e7117e8486391ecb38884 Mon Sep 17 00:00:00 2001 From: Matthew Whitaker Date: Tue, 11 Mar 2025 16:18:54 -0600 Subject: [PATCH] fix: fixed regression in list marker positioning --- lib/src/css_box_widget.dart | 16 +++++++++------- lib/src/style.dart | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/src/css_box_widget.dart b/lib/src/css_box_widget.dart index c6870a3929..77d545d022 100644 --- a/lib/src/css_box_widget.dart +++ b/lib/src/css_box_widget.dart @@ -616,13 +616,15 @@ class RenderCSSBox extends RenderBox RenderBox? markerBox = childParentData.nextSibling; if (markerBox != null) { final markerBoxParentData = markerBox.parentData! as CSSBoxParentData; - final distance = (child.getDistanceToBaseline(TextBaseline.alphabetic, - onlyReal: true) ?? - 0) + - topOffset; - final offsetHeight = distance - - (markerBox.getDistanceToBaseline(TextBaseline.alphabetic) ?? - markerBox.size.height); + // final distance = (child.getDistanceToBaseline(TextBaseline.alphabetic, + // onlyReal: true) ?? + // 0) + + // topOffset; + // final offsetHeight = distance - + // (markerBox.getDistanceToBaseline(TextBaseline.alphabetic) ?? + // markerBox.size.height); + // TODO handle block children better by modifying above approach + final offsetHeight = topOffset; switch (_textDirection) { case TextDirection.rtl: markerBoxParentData.offset = Offset( diff --git a/lib/src/style.dart b/lib/src/style.dart index 3d293de8b0..e605ee43fa 100644 --- a/lib/src/style.dart +++ b/lib/src/style.dart @@ -297,7 +297,7 @@ class Style { TextStyle generateTextStyle() { return TextStyle( - backgroundColor: backgroundColor, + backgroundColor: (display?.isBlock ?? false) ? null : backgroundColor, color: color, decoration: textDecoration, decorationColor: textDecorationColor,