Struct egui_graph::Camera
source · pub struct Camera {
pub pos: Pos2,
}
Expand description
A top-down camera-like view over the area of the graph.
Fields§
§pos: Pos2
Location of the camera relative to the center of the graph.
Implementations§
source§impl Camera
impl Camera
sourcepub fn graph_to_screen(&self, graph_rect: Rect, pos: Pos2) -> Pos2
pub fn graph_to_screen(&self, graph_rect: Rect, pos: Pos2) -> Pos2
Convert the given point pos
from graph space (position is relative to centre of
graph) to screen space (where the point is currently visible within the UI).
sourcepub fn screen_to_graph(&self, graph_rect: Rect, pos: Pos2) -> Pos2
pub fn screen_to_graph(&self, graph_rect: Rect, pos: Pos2) -> Pos2
Convert the given point pos
from screen space (where the point is currently
visible within the UI) to graph space (position is relative to centre of graph).
Trait Implementations§
source§impl<'de> Deserialize<'de> for Camera
impl<'de> Deserialize<'de> for Camera
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
source§impl PartialEq for Camera
impl PartialEq for Camera
impl StructuralPartialEq for Camera
Auto Trait Implementations§
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnwindSafe for Camera
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