Skip to content

Commit bdadc1f

Browse files
Fixed event handling when inserting events
1 parent d3c80f1 commit bdadc1f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/window.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,20 @@ impl Window {
411411
/// Could be usefull with a custom event loop
412412
/// or for keyboard control from elsewhere
413413
pub fn insert_event(&mut self, event: Event) {
414+
match event {
415+
Event::Resize(width, height) => {
416+
if self.inline.is_none() {
417+
self.buffers = [
418+
Buffer::new_filled((width, height), ' '),
419+
Buffer::new_filled((width, height), ' '),
420+
];
421+
self.just_resized = true;
422+
}
423+
}
424+
Event::Mouse(MouseEvent { column, row, .. }) => self.mouse_pos = vec2(column, row),
425+
_ => {}
426+
}
427+
414428
self.events.push(event);
415429
}
416430

0 commit comments

Comments
 (0)