pub struct MetadataFrame {
pub zoom: f32,
pub pan: Vec2,
pub last_step_time_ms: f32,
pub last_draw_time_ms: f32,
/* private fields */
}Fields§
§zoom: f32Current zoom factor
pan: Vec2Current pan offset
last_step_time_ms: f32Last measured time to compute one layout step (milliseconds)
last_draw_time_ms: f32Last measured time to draw the current frame, excluding the layout step (milliseconds)
Implementations§
Source§impl MetadataFrame
impl MetadataFrame
pub fn new(id: Option<String>) -> Self
pub fn load(self, ui: &Ui) -> Self
pub fn save(self, ui: &mut Ui)
pub fn canvas_to_screen_pos(&self, pos: Pos2) -> Pos2
pub fn canvas_to_screen_size(&self, size: f32) -> f32
pub fn screen_to_canvas_pos(&self, pos: Pos2) -> Pos2
pub fn process_bounds<N: Clone, E: Clone, Ty: EdgeType, Ix: IndexType, D: DisplayNode<N, E, Ty, Ix>>( &mut self, n: &Node<N, E, Ty, Ix, D>, )
Sourcepub fn expand_bounds(&mut self, min: Pos2, max: Pos2)
pub fn expand_bounds(&mut self, min: Pos2, max: Pos2)
Expands current bounds with provided rectangle (in canvas coordinates)
Sourcepub fn graph_bounds(&self) -> Rect
pub fn graph_bounds(&self) -> Rect
Returns bounding rect of the graph.
Sourcepub fn reset_bounds(&mut self)
pub fn reset_bounds(&mut self)
Resets the bounds iterator.
Trait Implementations§
Source§impl Clone for MetadataFrame
impl Clone for MetadataFrame
Source§fn clone(&self) -> MetadataFrame
fn clone(&self) -> MetadataFrame
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetadataFrame
impl Debug for MetadataFrame
Source§impl Default for MetadataFrame
impl Default for MetadataFrame
Source§impl<'de> Deserialize<'de> for MetadataFrame
impl<'de> Deserialize<'de> for MetadataFrame
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MetadataFrame
impl RefUnwindSafe for MetadataFrame
impl Send for MetadataFrame
impl Sync for MetadataFrame
impl Unpin for MetadataFrame
impl UnwindSafe for MetadataFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more