@@ -3355,6 +3355,23 @@ abstract class ParagraphBuilder {
33553355 /// [Paragraph] .
33563356 factory ParagraphBuilder (ParagraphStyle style) = _NativeParagraphBuilder ;
33573357
3358+ /// Whether the rounding hack enabled by default in SkParagraph and TextPainter
3359+ /// is disabled.
3360+ ///
3361+ /// Do not rely on this getter as it exists for migration purposes only and
3362+ /// will soon be removed.
3363+ @Deprecated ('''
3364+ The shouldDisableRoundingHack flag is for internal migration purposes only and should not be used.
3365+ ''' )
3366+ static bool get shouldDisableRoundingHack => _shouldDisableRoundingHack;
3367+ static bool _shouldDisableRoundingHack = true ;
3368+ /// Do not call this method as it is for migration purposes only and will soon
3369+ /// be removed.
3370+ // ignore: use_setters_to_change_properties
3371+ static void setDisableRoundingHack (bool disableRoundingHack) {
3372+ _shouldDisableRoundingHack = disableRoundingHack;
3373+ }
3374+
33583375 /// The number of placeholders currently in the paragraph.
33593376 int get placeholderCount;
33603377
@@ -3472,10 +3489,11 @@ base class _NativeParagraphBuilder extends NativeFieldWrapperClass1 implements P
34723489 style._height ?? 0 ,
34733490 style._ellipsis ?? '' ,
34743491 _encodeLocale (style._locale),
3492+ ! ParagraphBuilder .shouldDisableRoundingHack,
34753493 );
34763494 }
34773495
3478- @Native < Void Function (Handle , Handle , Handle , Handle , Handle , Double , Double , Handle , Handle )> (symbol: 'ParagraphBuilder::Create' )
3496+ @Native < Void Function (Handle , Handle , Handle , Handle , Handle , Double , Double , Handle , Handle , Bool )> (symbol: 'ParagraphBuilder::Create' )
34793497 external void _constructor (
34803498 Int32List encoded,
34813499 ByteData ? strutData,
@@ -3485,7 +3503,7 @@ base class _NativeParagraphBuilder extends NativeFieldWrapperClass1 implements P
34853503 double height,
34863504 String ellipsis,
34873505 String locale,
3488- );
3506+ bool applyRoundingHack );
34893507
34903508 @override
34913509 int get placeholderCount => _placeholderCount;
0 commit comments