From 74982d6c8e3e3d2d16e8f77821f9bcd839863c23 Mon Sep 17 00:00:00 2001 From: hm21 Date: Sat, 22 Jun 2024 21:41:53 +0200 Subject: [PATCH] fix(text-editor): remove duplicate text-shadow from invisible text-field - Fixed issue where text-shadow was displayed twice from an invisible text-field - This resolves issue [#131](https://github.com/hm21/pro_image_editor/issues/131) --- CHANGELOG.md | 1 + example/lib/pages/reorder_layer_example.dart | 10 ++++---- lib/modules/text_editor/text_editor.dart | 25 +++++++++++--------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0db80252..ad62bb6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Version 4.0.10 - **feat(text-editor)**: Add autocorrect and enableSuggestions configs. This was requsted in [#132](https://github.com/hm21/pro_image_editor/issues/132) +- **fix(text-editor)**: Remove duplicate text-shadow from invisible text-field. This resolves issue [#131](https://github.com/hm21/pro_image_editor/issue/131). ## Version 4.0.9 - **fix(emoji-picker)**: Ensure the emoji-picker is rendered inside the safe areas. This resolves issue [#126](https://github.com/hm21/pro_image_editor/issue/126). diff --git a/example/lib/pages/reorder_layer_example.dart b/example/lib/pages/reorder_layer_example.dart index b2a6d893..af8a48fa 100644 --- a/example/lib/pages/reorder_layer_example.dart +++ b/example/lib/pages/reorder_layer_example.dart @@ -48,9 +48,9 @@ class _ReorderLayerExampleState extends State onCloseEditor: onCloseEditor, ), configs: ProImageEditorConfigs( - designMode: platformDesignMode, - customWidgets: - ImageEditorCustomWidgets(mainEditor: CustomWidgetsMainEditor( + designMode: platformDesignMode, + customWidgets: ImageEditorCustomWidgets( + mainEditor: CustomWidgetsMainEditor( bodyItems: (editor, rebuildStream) { return [ ReactiveCustomWidget( @@ -97,7 +97,9 @@ class _ReorderLayerExampleState extends State ), ]; }, - ))), + ), + ), + ), ); } } diff --git a/lib/modules/text_editor/text_editor.dart b/lib/modules/text_editor/text_editor.dart index 94637f98..5cd2b9a8 100644 --- a/lib/modules/text_editor/text_editor.dart +++ b/lib/modules/text_editor/text_editor.dart @@ -640,23 +640,26 @@ class TextEditorState extends State cursorHeight: _getTextFontSize * 1.2, scrollPhysics: const NeverScrollableScrollPhysics(), decoration: InputDecoration( - border: InputBorder.none, - contentPadding: EdgeInsets.fromLTRB( - 12, _numLines <= 1 ? 4 : 0, 12, 0), - hintText: _textCtrl.text.isEmpty - ? i18n.textEditor.inputHintText - : '', - hintStyle: selectedTextStyle.copyWith( - color: imageEditorTheme.textEditor.inputHintColor, - fontSize: _getTextFontSize, - height: 1.35, - )), + border: InputBorder.none, + contentPadding: EdgeInsets.fromLTRB( + 12, _numLines <= 1 ? 4 : 0, 12, 0), + hintText: _textCtrl.text.isEmpty + ? i18n.textEditor.inputHintText + : '', + hintStyle: selectedTextStyle.copyWith( + color: imageEditorTheme.textEditor.inputHintColor, + fontSize: _getTextFontSize, + height: 1.35, + shadows: [], + ), + ), style: selectedTextStyle.copyWith( color: Colors.transparent, fontSize: _getTextFontSize, height: 1.35, letterSpacing: 0, decoration: TextDecoration.none, + shadows: [], ), autofocus: true, ),