@@ -279,12 +279,6 @@ class _TextLayout {
279279 // object when it's no logner needed.
280280 ui.Paragraph _paragraph;
281281
282- // TODO(LongCatIsLooong): https://github.com/flutter/flutter/issues/31707
283- // remove this hack as well as the flooring in `layout`.
284- @pragma ('vm:prefer-inline' )
285- // ignore: deprecated_member_use
286- static double _applyFloatingPointHack (double layoutValue) => ui.ParagraphBuilder .shouldDisableRoundingHack ? layoutValue : layoutValue.ceilToDouble ();
287-
288282 /// Whether this layout has been invalidated and disposed.
289283 ///
290284 /// Only for use when asserts are enabled.
@@ -294,23 +288,23 @@ class _TextLayout {
294288 ///
295289 /// If a line ends with trailing spaces, the trailing spaces may extend
296290 /// outside of the horizontal paint bounds defined by [width] .
297- double get width => _applyFloatingPointHack ( _paragraph.width) ;
291+ double get width => _paragraph.width;
298292
299293 /// The vertical space required to paint this text.
300- double get height => _applyFloatingPointHack ( _paragraph.height) ;
294+ double get height => _paragraph.height;
301295
302296 /// The width at which decreasing the width of the text would prevent it from
303297 /// painting itself completely within its bounds.
304- double get minIntrinsicLineExtent => _applyFloatingPointHack ( _paragraph.minIntrinsicWidth) ;
298+ double get minIntrinsicLineExtent => _paragraph.minIntrinsicWidth;
305299
306300 /// The width at which increasing the width of the text no longer decreases the height.
307301 ///
308302 /// Includes trailing spaces if any.
309- double get maxIntrinsicLineExtent => _applyFloatingPointHack ( _paragraph.maxIntrinsicWidth) ;
303+ double get maxIntrinsicLineExtent => _paragraph.maxIntrinsicWidth;
310304
311305 /// The distance from the left edge of the leftmost glyph to the right edge of
312306 /// the rightmost glyph in the paragraph.
313- double get longestLine => _applyFloatingPointHack ( _paragraph.longestLine) ;
307+ double get longestLine => _paragraph.longestLine;
314308
315309 /// Returns the distance from the top of the text to the first baseline of the
316310 /// given type.
@@ -359,13 +353,6 @@ class _TextPainterLayoutCacheWithOffset {
359353 ui.Paragraph get paragraph => layout._paragraph;
360354
361355 static double _contentWidthFor (double minWidth, double maxWidth, TextWidthBasis widthBasis, _TextLayout layout) {
362- // TODO(LongCatIsLooong): remove the rounding when _applyFloatingPointHack
363- // is removed.
364- // ignore: deprecated_member_use
365- if (! ui.ParagraphBuilder .shouldDisableRoundingHack) {
366- minWidth = minWidth.floorToDouble ();
367- maxWidth = maxWidth.floorToDouble ();
368- }
369356 return switch (widthBasis) {
370357 TextWidthBasis .longestLine => clampDouble (layout.longestLine, minWidth, maxWidth),
371358 TextWidthBasis .parent => clampDouble (layout.maxIntrinsicLineExtent, minWidth, maxWidth),
0 commit comments