Add IME support for Windows

This commit is contained in:
Khinenw 2021-01-15 17:48:30 +09:00 committed by GitHub
parent 80f7adf20f
commit 3ed9f9ac38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## 0.8.0-dev
### Added
- IME composition preview not appearing on Windows
### Fixed
- Crash due to assertion failure on 32-bit architectures

View File

@ -421,7 +421,6 @@ impl Window {
}
/// Adjust the IME editor position according to the new location of the cursor.
#[cfg(not(windows))]
pub fn update_ime_position(&mut self, point: Point, size: &SizeInfo) {
let nspot_x = f64::from(size.padding_x() + point.col.0 as f32 * size.cell_width());
let nspot_y = f64::from(size.padding_y() + (point.line.0 + 1) as f32 * size.cell_height());
@ -429,10 +428,6 @@ impl Window {
self.window().set_ime_position(PhysicalPosition::new(nspot_x, nspot_y));
}
/// No-op, since Windows does not support IME positioning.
#[cfg(windows)]
pub fn update_ime_position(&mut self, _point: Point, _size_info: &SizeInfo) {}
pub fn swap_buffers(&self) {
self.windowed_context.swap_buffers().expect("swap buffers");
}