1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Add RawInput::is_visible and InputState::is_visible helpers

Shorthand for `viewport().visible().unwrap_or(true)`, which was
repeated at every call site.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Emil Ernerfeldt
2026-08-04 17:08:50 +02:00
parent 51047205d8
commit 4d444aafb4
5 changed files with 28 additions and 6 deletions

View File

@@ -259,7 +259,7 @@ impl<'a, State> Harness<'a, State> {
fn _step(&mut self, sizing_pass: bool) {
self.input.predicted_dt = self.step_dt;
let is_visible = self.input.viewport().visible().unwrap_or(true);
let is_visible = self.input.is_visible();
let mut output = self.ctx.run_ui(self.input.take(), |ui| {
self.response = self.app.run(ui, &mut self.state, sizing_pass);