Skip to content

Commit

Permalink
add comments, copy input_options for InputState
Browse files Browse the repository at this point in the history
  • Loading branch information
girtsf committed Sep 4, 2024
1 parent 97eaf83 commit 0e36e62
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/egui/src/input_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ impl InputOptions {
max_click_duration,
max_double_click_delay,
} = self;
use crate::containers::*;
CollapsingHeader::new("InputOptions")
crate::containers::CollapsingHeader::new("InputOptions")
.default_open(false)
.show(ui, |ui| {
ui.horizontal(|ui| {
Expand Down Expand Up @@ -226,6 +225,8 @@ pub struct InputState {
pub events: Vec<Event>,

/// Input state management configuration.
///
/// This gets copied from `egui::Options` at the start of each frame for convenience.
input_options: InputOptions,
}

Expand Down Expand Up @@ -428,7 +429,7 @@ impl InputState {
keys_down,
events: new.events.clone(), // TODO(emilk): remove clone() and use raw.events
raw: new,
input_options: self.input_options,
input_options: options.input_options.clone(),
}
}

Expand Down Expand Up @@ -867,6 +868,8 @@ pub struct PointerState {
pub(crate) pointer_events: Vec<PointerEvent>,

/// Input state management configuration.
///
/// This gets copied from `egui::Options` at the start of each frame for convenience.
input_options: InputOptions,
}

Expand Down

0 comments on commit 0e36e62

Please sign in to comment.