fix square filter, arrow keys on windows

This commit is contained in:
2022-07-12 20:18:06 +02:00
parent e9a5f702b4
commit 539d19e0d7
2 changed files with 8 additions and 6 deletions

View File

@@ -126,15 +126,17 @@ impl Window {
WindowEvent::KeyboardInput { input, .. } => {
fn gamepad_button(input: &winit::event::KeyboardInput) -> u32 {
match input.scancode {
103 => 1,
108 => 2,
105 => 4,
106 => 8,
44 => 16,
45 => 32,
30 => 64,
31 => 128,
_ => match input.virtual_keycode {
Some(VirtualKeyCode::Up) => 1,
Some(VirtualKeyCode::Down) => 2,
Some(VirtualKeyCode::Left) => 4,
Some(VirtualKeyCode::Right) => 8,
_ => 0,
},
}
}
if input.state == winit::event::ElementState::Pressed {

View File

@@ -32,7 +32,7 @@ fn aa_tex_coord(c: f32) -> f32 {
let center = base + 0.5;
let next = base + 1.0;
if high > next {
return center + (high - next) / (high - base);
return center + (high - next) / (high - low);
} else {
return center;
}