summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-13 01:50:27 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-13 01:50:27 +0100
commit88ffba4a3a4d10fa68e31f0a2d6137691a7735cb (patch)
tree2e2e93201acce1751c894e698d6dc36efc82ec54
parentf62529747570144eb3e4822dde514d46a65b86ee (diff)
downloadiced-88ffba4a3a4d10fa68e31f0a2d6137691a7735cb.tar.gz
iced-88ffba4a3a4d10fa68e31f0a2d6137691a7735cb.tar.bz2
iced-88ffba4a3a4d10fa68e31f0a2d6137691a7735cb.zip
Simplify preedit overlay creation
-rw-r--r--winit/src/program/window_manager.rs11
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,