From dc234d53579079fd4c9ba0fdec15f08307b57f3d Mon Sep 17 00:00:00 2001 From: hm21 Date: Sat, 21 Mar 2026 19:06:48 +0100 Subject: [PATCH] fix(text-editor): disable system text scale factor in RoundedBackgroundTextField for consistent text sizing --- CHANGELOG.md | 3 ++ .../rounded_background_text_field.dart | 29 ++++++++++--------- pubspec.yaml | 4 +-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dc272828..2f5f81227 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 12.0.9 +- **FIX**(text-editor): Disable system text scale factor in `RoundedBackgroundTextField` to ensure consistent text sizing regardless of user accessibility settings. + ## 12.0.8 - **PERF**(paint-editor): Optimize freestyle path building by reducing redundant `moveTo` calls, eliminating intermediate list allocations, and using `distanceSquared` instead of `distance`. - **PERF**(paint-editor): Skip `Opacity` widget wrapping when layer opacity is 1.0. diff --git a/lib/features/text_editor/widgets/rounded_background_text/rounded_background_text_field.dart b/lib/features/text_editor/widgets/rounded_background_text/rounded_background_text_field.dart index 1dff41128..d242e55ad 100644 --- a/lib/features/text_editor/widgets/rounded_background_text/rounded_background_text_field.dart +++ b/lib/features/text_editor/widgets/rounded_background_text/rounded_background_text_field.dart @@ -121,19 +121,22 @@ class _RoundedBackgroundTextFieldState final fontSize = (widget.style.fontSize ?? defaultTextStyle.style.fontSize ?? 16); - return Stack( - clipBehavior: Clip.none, - alignment: switch (widget.textAlign) { - TextAlign.end => AlignmentDirectional.centerEnd, - TextAlign.start => AlignmentDirectional.centerStart, - TextAlign.left => Alignment.centerLeft, - TextAlign.right => Alignment.centerRight, - TextAlign.center || _ => Alignment.topCenter, - }, - children: [ - if (_textController.text.isNotEmpty) _buildBackgroundText(), - _buildEditableText(fontSize: fontSize), - ], + return MediaQuery( + data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling), + child: Stack( + clipBehavior: Clip.none, + alignment: switch (widget.textAlign) { + TextAlign.end => AlignmentDirectional.centerEnd, + TextAlign.start => AlignmentDirectional.centerStart, + TextAlign.left => Alignment.centerLeft, + TextAlign.right => Alignment.centerRight, + TextAlign.center || _ => Alignment.topCenter, + }, + children: [ + if (_textController.text.isNotEmpty) _buildBackgroundText(), + _buildEditableText(fontSize: fontSize), + ], + ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index 597161ff4..42ede3194 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pro_image_editor description: "A Flutter image editor: Seamlessly enhance your images with user-friendly editing features." -version: 12.0.8 +version: 12.0.9 homepage: https://github.com/hm21/pro_image_editor/ repository: https://github.com/hm21/pro_image_editor/ documentation: https://github.com/hm21/pro_image_editor/ @@ -62,10 +62,8 @@ flutter: pluginClass: ProImageEditorPlugin ios: pluginClass: ProImageEditorPlugin - sharedDarwinSource: true macos: pluginClass: ProImageEditorPlugin - sharedDarwinSource: true assets: - path: lib/web/web_worker.dart.js platforms: [web]