New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextFormField scroll content show afterimage in IOS device #108590
Comments
Hello @zhongkai886. Looks like you're using |
already upgrade version 3.0.5 , but emoji afterimage still appear.
|
Thank you @zhongkai886. I can reproduce this issue in stable and master. Video108590_ios_master.movCode sampleimport 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final controller = TextEditingController();
@override
void initState() {
super.initState();
controller.text = '🙂' * 40;
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: SizedBox(
height: 60,
child: TextFormField(
controller: controller,
maxLines: null,
),
),
),
);
}
}
|
I can reproduce that with a
@jason-simmons any chance you could take a look? |
This is happening because the bounds rectangle calculated for the emoji text is inaccurate. The Flutter compositor then uses the text bounds to compute the damage rectangle affected by the animation. The resulting damage rect is too small, causing content from the previous frame to remain after the new frame is painted. The text bounds are taken from Skia's I can get this issue to disappear by patching @bungeman @Rusino What would be the best way to handle this? Would it make sense for Skia to select |
Hmmm... yes, the conservative bounds technically only apply to the (non-variable) glyph outlines, not necessarily to the bitmaps (though in theory they should). We already have a means for the actual underlying port to state that the conservative bounds are bogus and should not be used. It looks like perhaps the CoreText port should state that the conservative bounds are bogus if at least some glyphs in the font are not going to be drawn from paths (the font has an |
Created https://skia-review.googlesource.com/c/skia/+/585421 which should address this issue. |
The conservative font bounds reported by CoreText are those in the font and are meant primarially for (and are generally calculated only for) the default instance of the glyph outlines in the font. In particular they do not generally apply to `sbix` and `SVG ` data. When these tables are present the conservative font bounds reported by the font should be considered invalid since glyph representations used may not be outlines. Bug: flutter/flutter#108590 Change-Id: I9d591e4327839f0660413683bcc223d6b76849ef Reviewed-on: https://skia-review.googlesource.com/c/skia/+/585421 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com>
Verified that https://skia-review.googlesource.com/c/skia/+/585421 fixes this |
The Skia change is rolled into Flutter with flutter/engine#36475 . |
Since flutter/engine#36475 is merged, marking this issue as fixed. |
awesome thanks guys |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
flutter run
on the code sample .Expected results:
like OfficialSample
can scroll content and watch normal over content
Actual results:
content will show afterimage in IOS device
RPReplay_Final1659000932.mov
Code sample
Logs
The text was updated successfully, but these errors were encountered: