pub struct EditorScale { /* private fields */ }Implementations§
Source§impl EditorScale
impl EditorScale
Sourcepub fn new(initial: f64) -> Self
pub fn new(initial: f64) -> Self
Construct with an initial scale. Non-finite or non-positive
values clamp to 1.0 so callers never have to defend against
0.0 * size collapsing the surface.
Sourcepub fn get_f32(&self) -> f32
pub fn get_f32(&self) -> f32
Read the current scale, narrowed to f32 for renderer / DSP
use. Display scales never exceed 4.0 in practice, so the f64
→ f32 narrowing is invisible.
Sourcepub fn set(&self, scale: f64)
pub fn set(&self, scale: f64)
Update the current scale. Non-finite or non-positive values are
silently dropped - callers are forwarding numbers from hosts /
info.scale() where a bad value is a host bug, not something
to propagate into the surface config.
Sourcepub fn take_change(&self, last: &mut f32) -> Option<f32>
pub fn take_change(&self, last: &mut f32) -> Option<f32>
Pick up a host-driven scale change since the last frame.
Reads the current scale (narrowed to f32) and compares it
bit-identically against last. When the value moved, updates
last and returns Some(cur); otherwise returns None.
Used by every editor backend’s per-frame loop to gate surface /
renderer reconfiguration on actual host scale events. Bit-equality
is the correct semantics - the cell is written verbatim from
host callbacks, never through accumulating arithmetic, so an
epsilon-based check would either thrash on noise (there is
none) or miss a legitimate 1.0 → 1.0001 host signal.
Trait Implementations§
Source§impl Clone for EditorScale
impl Clone for EditorScale
Source§fn clone(&self) -> EditorScale
fn clone(&self) -> EditorScale
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more