pub struct DgFrame<'a> {
pub vp: Viewport,
pub clip: [f32; 4],
pub geo: &'a DgGeo,
pub theme: &'a [u32],
pub bg: u32,
pub fonts: [(u32, i32); 7],
pub dark: bool,
pub moving: bool,
}Expand description
what a DgPaint gets at render time
Fields§
§vp: Viewport§clip: [f32; 4]the world rectangle x0, y0, x1, y1 that needs pixels now: skip what lies outside
geo: &'a DgGeo§theme: &'a [u32]the theme’s colours (color(T_*)), the canvas background (opaque)
bg: u32§fonts: [(u32, i32); 7]font and size (24.8 px at zoom 1) of every TS_* text style
dark: bool§moving: boola gesture moves the view or nodes (a pan, wheel turns, a drag of nodes or a waypoint): leave out what costs and nobody reads in passing (small labels; plain shapes, dg_hairline); the canvas is painted in full after it
Implementations§
Source§impl DgFrame<'_>
impl DgFrame<'_>
Sourcepub fn visible(&self, r: [f32; 4]) -> bool
pub fn visible(&self, r: [f32; 4]) -> bool
the world rectangle x, y, w, h (with 2 px for anti-aliasing) touches the clip
Sourcepub fn route_visible(&self, rt: &DgRoute, width: f32) -> bool
pub fn route_visible(&self, rt: &DgRoute, width: f32) -> bool
a route stroked width world units wide (dg_stroke_edge, arrow heads included)
touches the clip
Auto Trait Implementations§
impl<'a> Forget for DgFrame<'a>
impl<'a> Freeze for DgFrame<'a>
impl<'a> RefUnwindSafe for DgFrame<'a>
impl<'a> Send for DgFrame<'a>
impl<'a> Sync for DgFrame<'a>
impl<'a> Unpin for DgFrame<'a>
impl<'a> UnsafeUnpin for DgFrame<'a>
impl<'a> UnwindSafe for DgFrame<'a>
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