fixed some issues with text rendering

This commit is contained in:
2025-04-26 19:41:07 +02:00
parent 3715ecf841
commit b0ecc5623c
4 changed files with 161 additions and 486 deletions

View File

@@ -2,7 +2,6 @@ use std::sync::Arc;
use tokio::runtime::Runtime;
use winit::dpi::LogicalSize;
use winit::event::WindowEvent;
use winit::keyboard::{Key, NamedKey};
use winit::window::Window;
mod rendering;
@@ -60,23 +59,7 @@ impl winit::application::ApplicationHandler for Application {
is_synthetic: _,
} => {
if event.state.is_pressed() {
match event.logical_key {
Key::Named(k) => match k {
NamedKey::Enter => {
state.handle_enter();
}
_ => todo!(),
},
Key::Character(c) => {
state.add_text(&event.text.unwrap());
}
Key::Dead(_) => {
todo!()
}
Key::Unidentified(_) => {
todo!()
}
}
state.handle_keyboard_input(&event);
}
}
WindowEvent::CloseRequested => event_loop.exit(),