diff options
author | 2025-02-06 09:57:01 +0900 | |
---|---|---|
committer | 2025-02-06 09:57:01 +0900 | |
commit | cf851e133ad6aaedaf07b58c68e7c41d41ee151a (patch) | |
tree | f46a9317e23ebe32018dad80d0c2269e43515cca /widget | |
parent | fcdf53afdee9cd12bf2e01c5f6e572859b9a3f96 (diff) | |
download | iced-cf851e133ad6aaedaf07b58c68e7c41d41ee151a.tar.gz iced-cf851e133ad6aaedaf07b58c68e7c41d41ee151a.tar.bz2 iced-cf851e133ad6aaedaf07b58c68e7c41d41ee151a.zip |
Do not pass text size to `Preedit::new`
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/text_editor.rs | 4 | ||||
-rw-r--r-- | widget/src/text_input.rs | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index df42d601..ac458951 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -754,7 +754,9 @@ where Update::InputMethod(update) => match update { Ime::Toggle(is_open) => { state.preedit = is_open.then(|| { - input_method::Preedit::new(self.text_size) + let mut preedit = input_method::Preedit::new(); + preedit.text_size = self.text_size; + preedit }); shell.request_redraw(); diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index de957e14..6d317490 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -1261,8 +1261,13 @@ where let state = state::<Renderer>(tree); state.is_ime_open = - matches!(event, input_method::Event::Opened) - .then(|| input_method::Preedit::new(self.size)); + matches!(event, input_method::Event::Opened).then( + || { + let mut preedit = input_method::Preedit::new(); + preedit.text_size = self.size; + preedit + }, + ); shell.request_redraw(); } |