Skip to content

Commit 5b51c8d

Browse files
committed
chore: sync ime changes
1 parent 52061d5 commit 5b51c8d

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

iced_layershell/src/ime_preedit.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub struct Preedit<Renderer>
88
where
99
Renderer: text::Renderer,
1010
{
11-
cursor: Rectangle,
11+
position: Point,
1212
content: Renderer::Paragraph,
1313
spans: Vec<text::Span<'static, (), Renderer::Font>>,
1414
}
@@ -28,7 +28,7 @@ where
2828
{
2929
pub fn new() -> Self {
3030
Self {
31-
cursor: Rectangle::default(),
31+
position: Point::ORIGIN,
3232
spans: Vec::new(),
3333
content: Renderer::Paragraph::default(),
3434
}
@@ -41,8 +41,7 @@ where
4141
background: Color,
4242
renderer: &Renderer,
4343
) {
44-
self.cursor = cursor;
45-
44+
self.position = cursor.position() + Vector::new(0.0, cursor.height);
4645
let spans = match &preedit.selection {
4746
Some(selection) => {
4847
vec![
@@ -94,7 +93,7 @@ where
9493
}
9594

9695
let mut bounds = Rectangle::new(
97-
self.cursor.position() - Vector::new(0.0, self.content.min_height()),
96+
self.position - Vector::new(0.0, self.content.min_height()),
9897
self.content.min_bounds(),
9998
);
10099

iced_layershell/src/multi_window/window_manager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ where
216216
}
217217
}
218218

219-
fn update_ime(&mut self, position: iced_core::Rectangle, purpose: input_method::Purpose) {
220-
if self.ime_state != Some((position, purpose)) {
221-
self.ime_state = Some((position, purpose));
219+
fn update_ime(&mut self, cursor: iced_core::Rectangle, purpose: input_method::Purpose) {
220+
if self.ime_state != Some((cursor, purpose)) {
221+
self.ime_state = Some((cursor, purpose));
222222
}
223223
}
224224

iced_sessionlock/src/conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub(crate) fn mouse_interaction(interaction: mouse::Interaction) -> String {
171171
Interaction::ZoomOut => Shape::ZoomOut.name().to_owned(),
172172
Interaction::ResizingDiagonallyUp => Shape::NwseResize.name().to_owned(),
173173
Interaction::ResizingDiagonallyDown => Shape::NwseResize.name().to_owned(),
174-
_ => Shape::Default.name().to_owned()
174+
_ => Shape::Default.name().to_owned(),
175175
}
176176
}
177177

0 commit comments

Comments
 (0)