-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
The buttons in the text selection toolbar bounce on desktop #107733
Comments
I'm unable to reproduce on the latest master channel on the macOS desktop. Screen.Recording.2022-07-20.at.17.35.22.movCode Sampleimport 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key, this.dark = false, this.useMaterial3 = true});
final bool dark;
final bool useMaterial3;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
themeMode: dark ? ThemeMode.dark : ThemeMode.light,
theme: ThemeData(
useMaterial3: useMaterial3,
brightness: Brightness.light,
colorSchemeSeed: const Color(0xff6750a4),
),
darkTheme: ThemeData(
useMaterial3: useMaterial3,
brightness: Brightness.dark,
colorSchemeSeed: const Color(0xff6750a4),
),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('TextField'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextField(
controller: TextEditingController(
text:
'Flutter Flutter Flutter Flutter Flutter Flutter Flutter Flutter Flutter Flutter'),
style: const TextStyle(fontSize: 34.0),
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: const Icon(Icons.add),
),
);
}
}
|
Justin, where did you reproduce this? It looks like it's drawing a different menu from the one that Taha shows. (Desktop Triage) |
Sorry, this was on Linux! I just tried it again and I still see it on Linux, using a physical mouse. I tried on Mac and did not see it, using a trackpad. Not sure if that has anything to do with it. It seems strange that the platform would affect this. |
This is caused by fractional translation. It's not 100% deterministic but relatively easy to reproduce with popups and dialogs and device pixel ratio 1. fractional.mp4 |
Likely same as #107921 (seen on Windows, also with dialogs, Chips etc.) |
With fractional coordinates, it's not enough to round up device bounds width and height. Round out to get a large enough integer-size texture. Fixes: flutter/flutter#107733 Fixes: flutter/flutter#107921 Fixes: flutter/flutter#109608
With fractional coordinates, it's not enough to round up device bounds width and height. Round out to get a large enough integer-size texture. Fixes: flutter/flutter#107733 Fixes: flutter/flutter#107921 Fixes: flutter/flutter#109608
With fractional coordinates, it's not enough to round up device bounds width and height. Round out to get a large enough integer-size texture. Fixes: flutter/flutter#107733 Fixes: flutter/flutter#107921 Fixes: flutter/flutter#109608
With fractional coordinates, it's not enough to round up device bounds width and height. Round out to get a large enough integer-size texture. Fixes: flutter/flutter#107733 Fixes: flutter/flutter#107921 Fixes: flutter/flutter#109608
@jpnurmi Thanks for the insight! @jonahwilliams Could you help me understand how #103909 affects this bug? I'm wondering if it will be fixed by that or if there's anything else we need to do in the framework. |
I have not debugged the issue, though @jpnurmi is looking at it. #103909 landed a long time ago - essentially it removed forced pixel snapping from composited layers. That fixed some instances of the above, where an animated transition would appear to "snap" into place as it concluded. According to some other filled issues, that makes some previous rendering that would have been pixel aligned non-pixel aligned, and so on low DPR there can be apparent snapping as something animates across pixels. Its possible there is another issue mixed in, where we might still be rounding out in places - which would actually be a bug and not just an artifact of rendering at low DPR |
Thanks I appreciate the explanation! I'll keep an eye out for an update from @jpnurmi. A large monitor like where I saw this bug would be a low DPR compared to a late model smartphone if I'm not mistaken, so maybe that's evidence in favor of this being due to the snapping thing. |
Right, so if you're on a low DPR device like a desktop monitor (probably 1.0 or 1.25), then drawing something like text at fractional pixel boundaries may be a noticable shift from pixel aligned (depending on a lot of other things like how AA is working). The pixel snapping I removed worked at the level of the composited layer, so if you painted text at 0,0 or at some other position that when multiplied by dpr landed at round number, your text was guaranteed to be pixel aligned. But as far as I know, you could still draw your text at something like 0.33, 0.33 and end up non-pixel aligned. In general, this is the same sort of problem as the hairline appearing between solid color containers. |
With checkerboard_raster_cache_images.mp4 |
I just tried the same and I was able to reproduce it on 4f95282 but not on tip of tree. It seems like it's been fixed, so I will close this, but if anyone else reproduces it on master let me know. |
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 |
On desktop, the buttons in the text selection toolbar have some small vertical movement after they appear. Notice the downward movement of the buttons in the gif below as I move my mouse.
Steps to reproduce
Expected: The toolbar buttons stay in place and don't move.
Actual: The toolbar buttons move vertically by a pixel or two.
Example app
The text was updated successfully, but these errors were encountered: