diff options
author | 2025-02-13 01:50:27 +0100 | |
---|---|---|
committer | 2025-02-13 01:50:27 +0100 | |
commit | 88ffba4a3a4d10fa68e31f0a2d6137691a7735cb (patch) | |
tree | 2e2e93201acce1751c894e698d6dc36efc82ec54 | |
parent | f62529747570144eb3e4822dde514d46a65b86ee (diff) | |
download | iced-88ffba4a3a4d10fa68e31f0a2d6137691a7735cb.tar.gz iced-88ffba4a3a4d10fa68e31f0a2d6137691a7735cb.tar.bz2 iced-88ffba4a3a4d10fa68e31f0a2d6137691a7735cb.zip |
Simplify preedit overlay creation
-rw-r--r-- | winit/src/program/window_manager.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/winit/src/program/window_manager.rs b/winit/src/program/window_manager.rs index 25d3ad9c..4156e7c8 100644 --- a/winit/src/program/window_manager.rs +++ b/winit/src/program/window_manager.rs @@ -221,15 +221,10 @@ where if let Some(preedit) = preedit { if preedit.content.is_empty() { self.preedit = None; - } else if let Some(overlay) = &mut self.preedit { - overlay.update( - position, - &preedit, - self.state.background_color(), - &self.renderer, - ); } else { - let mut overlay = Preedit::new(); + let mut overlay = + self.preedit.take().unwrap_or_else(Preedit::new); + overlay.update( position, &preedit, |