1
0
Fork 0

Rename EguiState::open to is_open

This makes it more clear that it doesn't actually open the editor.
This commit is contained in:
Robbert van der Helm 2022-02-08 20:33:08 +01:00
parent d9ac60ae85
commit 07f9a18d3d
2 changed files with 3 additions and 2 deletions

View file

@ -80,7 +80,8 @@ impl EguiState {
}
/// Whether the GUI is currently visible.
pub fn open(&self) -> bool {
// Called `is_open()` instead of `open()` to avoid the ambiguity.
pub fn is_open(&self) -> bool {
self.open.load(Ordering::Acquire)
}
}

View file

@ -180,7 +180,7 @@ impl Plugin for Gain {
// To save resources, a plugin can (and probably should!) only perform expensive
// calculations that are only displayed on the GUI while the GUI is open
if self.editor_state.open() {
if self.editor_state.is_open() {
amplitude = (amplitude / num_samples as f32).abs();
let current_peak_meter = self.peak_meter.load(std::sync::atomic::Ordering::Relaxed);
let new_peak_meter = if amplitude > current_peak_meter {