diff --git a/lib/real_rich_text.dart b/lib/real_rich_text.dart index 5ddca3d..c5a2a34 100644 --- a/lib/real_rich_text.dart +++ b/lib/real_rich_text.dart @@ -160,6 +160,18 @@ class ImageSpan extends TextSpan { double get width => imageWidth + (margin == null ? 0 : margin.horizontal); double get height => imageHeight + (margin == null ? 0 : margin.vertical); + + @override + RenderComparison compareTo(covariant ImageSpan other) { + RenderComparison comparison = super.compareTo(other); + if (other.imageProvider != imageProvider || + other.imageWidth != imageWidth || + other.imageHeight != imageHeight || + other.margin != margin) { + comparison = RenderComparison.layout; + } + return comparison; + } } typedef ImageResolverListener = void Function(