anchor.diff:      final int chunkEnd = brk.index;
       final double width = _measureSubstring(
         _canvasContext,
  -      _style,
         _text,
         _lastChunkEnd,
         brk.indexWithoutTrailingSpaces,
  +      letterSpacing: _style.letterSpacing,
       );
       if (width > value) {
         value = width;
  
positive.code:     return 0;
    }
  
    if (start == _lastStart &&
        end == _lastEnd &&
        text == _lastText &&
        _lastStyle == style) {
      // TODO(mdebbar): Explore caching all widths in a map, not only the last one.
      return _lastWidth;
    }
    _lastStart = start;
    _lastEnd = end;
    _lastText = text;
    _lastStyle = style;
  
    final double letterSpacing = style.letterSpacing ?? 0.0;
    final String sub =
        start == 0 && end == text.length ? text : text.substring(start, end);
    final double width = _canvasContext.measureText(sub).width!.toDouble() +
        letterSpacing * sub.length;
  
    // What we are doing here is we are rounding to the nearest 2nd decimal
    // point. So 39.999423 becomes 40, and 11.243982 becomes 11.24.
    // The reason we are doing this is because we noticed that canvas API has a
    // ±0.001 error margin.
    return _lastWidth = _roundWidth(width);
  }
  
  double _roundWidth(double width) {
  
negative.code: 
      final double lineWidth = _measureSubstring(
        _canvasContext,
        _text,
        _lastHardLineEnd,
        brk.indexWithoutTrailingNewlines,
        letterSpacing: _style.letterSpacing,
      );
      if (lineWidth > value) {
        value = lineWidth;
  