Skip to content

Commit

Permalink
Use default size for empty pre-edits
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 12, 2025
1 parent cf851e1 commit 7199ed0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
7 changes: 2 additions & 5 deletions widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,8 @@ where
}
Update::InputMethod(update) => match update {
Ime::Toggle(is_open) => {
state.preedit = is_open.then(|| {
let mut preedit = input_method::Preedit::new();
preedit.text_size = self.text_size;
preedit
});
state.preedit =
is_open.then(input_method::Preedit::new);

shell.request_redraw();
}
Expand Down
9 changes: 2 additions & 7 deletions widget/src/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,13 +1261,8 @@ where
let state = state::<Renderer>(tree);

state.is_ime_open =
matches!(event, input_method::Event::Opened).then(
|| {
let mut preedit = input_method::Preedit::new();
preedit.text_size = self.size;
preedit
},
);
matches!(event, input_method::Event::Opened)
.then(input_method::Preedit::new);

shell.request_redraw();
}
Expand Down

0 comments on commit 7199ed0

Please sign in to comment.