David PHAM-VAN

Partially revert underline on spans changes

@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 ## 3.10.5 3 ## 3.10.5
4 4
5 - Improve TTF writer with multi-compound characters 5 - Improve TTF writer with multi-compound characters
  6 +- Partially revert underline on spans changes
6 7
7 ## 3.10.4 8 ## 3.10.4
8 9
@@ -49,14 +49,12 @@ enum TextOverflow { @@ -49,14 +49,12 @@ enum TextOverflow {
49 } 49 }
50 50
51 abstract class _Span { 51 abstract class _Span {
52 - _Span(this.style, this.realWidth); 52 + _Span(this.style);
53 53
54 final TextStyle style; 54 final TextStyle style;
55 55
56 var offset = PdfPoint.zero; 56 var offset = PdfPoint.zero;
57 57
58 - double realWidth;  
59 -  
60 double get left; 58 double get left;
61 59
62 double get top; 60 double get top;
@@ -105,13 +103,9 @@ class _TextDecoration { @@ -105,13 +103,9 @@ class _TextDecoration {
105 return _box; 103 return _box;
106 } 104 }
107 105
108 - final x1 = spans[startSpan].offset.x +  
109 - spans[startSpan].left +  
110 - spans[startSpan].realWidth;  
111 - final x2 = spans[endSpan].offset.x +  
112 - spans[endSpan].left +  
113 - spans[endSpan].width -  
114 - spans[endSpan].realWidth; 106 + final x1 = spans[startSpan].offset.x + spans[startSpan].left;
  107 + final x2 =
  108 + spans[endSpan].offset.x + spans[endSpan].left + spans[endSpan].width;
115 var y1 = spans[startSpan].offset.y + spans[startSpan].top; 109 var y1 = spans[startSpan].offset.y + spans[startSpan].top;
116 var y2 = y1 + spans[startSpan].height; 110 var y2 = y1 + spans[startSpan].height;
117 111
@@ -265,7 +259,7 @@ class _Word extends _Span { @@ -265,7 +259,7 @@ class _Word extends _Span {
265 this.text, 259 this.text,
266 TextStyle style, 260 TextStyle style,
267 this.metrics, 261 this.metrics,
268 - ) : super(style, metrics.advanceWidth); 262 + ) : super(style);
269 263
270 final String text; 264 final String text;
271 265
@@ -331,7 +325,7 @@ class _Word extends _Span { @@ -331,7 +325,7 @@ class _Word extends _Span {
331 } 325 }
332 326
333 class _WidgetSpan extends _Span { 327 class _WidgetSpan extends _Span {
334 - _WidgetSpan(this.widget, TextStyle style, this.baseline) : super(style, 0); 328 + _WidgetSpan(this.widget, TextStyle style, this.baseline) : super(style);
335 329
336 final Widget widget; 330 final Widget widget;
337 331