Skip to content

Commit

Permalink
fix: Change to FilterQuality.medium instead of high (#2733)
Browse files Browse the repository at this point in the history
According to the Flutter docs, tests and #2551 FilterQuality.high is actually producing worse output than FilterQuality.medium in almost all cases (the exception is when you use a very high scale factor).
This PRs set the places we have defined as high to medium instead.
  • Loading branch information
spydon committed Sep 12, 2023
1 parent 8726d03 commit fc19890
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/flame/lib/src/components/text_box_component.dart
Expand Up @@ -48,7 +48,7 @@ class TextBoxConfig {

class TextBoxComponent<T extends TextRenderer> extends TextComponent {
static final Paint _imagePaint = BasicPalette.white.paint()
..filterQuality = FilterQuality.high;
..filterQuality = FilterQuality.medium;
final TextBoxConfig _boxConfig;
final double pixelRatio;

Expand Down
Binary file modified packages/flame/test/_goldens/sprite_font_renderer_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/text_box_component_test_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/flame_svg/lib/svg.dart
Expand Up @@ -23,7 +23,7 @@ class Svg {

final MemoryCache<Size, Image> _imageCache = MemoryCache();

final _paint = Paint()..filterQuality = FilterQuality.high;
final _paint = Paint()..filterQuality = FilterQuality.medium;

final List<Size> _lock = [];

Expand Down
Binary file modified packages/flame_svg/test/_goldens/render_sharply.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fc19890

Please sign in to comment.