Struct widgetry::Canvas [−][src]
pub struct Canvas {}Show fields
pub cam_x: f64, pub cam_y: f64, pub cam_zoom: f64, pub(crate) cursor: ScreenPt, pub(crate) window_has_cursor: bool, pub(crate) drag_canvas_from: Option<(ScreenPt, ScreenPt)>, pub(crate) drag_just_ended: bool, pub window_width: f64, pub window_height: f64, pub map_dims: (f64, f64), pub settings: CanvasSettings, pub(crate) covered_areas: RefCell<Vec<ScreenRectangle>>, pub(crate) keys_held: HashSet<Key>,
Fields
cam_x: f64
cam_y: f64
cam_zoom: f64
cursor: ScreenPt
window_has_cursor: bool
drag_canvas_from: Option<(ScreenPt, ScreenPt)>
drag_just_ended: bool
window_width: f64
window_height: f64
map_dims: (f64, f64)
settings: CanvasSettings
covered_areas: RefCell<Vec<ScreenRectangle>>
keys_held: HashSet<Key>
Implementations
impl Canvas
[src]
impl Canvas
[src]pub(crate) fn new(initial_dims: ScreenDims, settings: CanvasSettings) -> Canvas
[src]
pub fn min_zoom(&self) -> f64
[src]
pub(crate) fn handle_event(
&mut self,
input: &mut UserInput
) -> Option<UpdateType>
[src]
&mut self,
input: &mut UserInput
) -> Option<UpdateType>
fn zoom(&mut self, delta: f64, focus: ScreenPt)
[src]
pub(crate) fn start_drawing(&self)
[src]
pub fn mark_covered_area(&self, rect: ScreenRectangle)
[src]
pub fn get_cursor(&self) -> ScreenPt
[src]
pub fn get_cursor_in_screen_space(&self) -> Option<ScreenPt>
[src]
pub fn get_cursor_in_map_space(&self) -> Option<Pt2D>
[src]
pub fn screen_to_map(&self, pt: ScreenPt) -> Pt2D
[src]
pub fn center_to_screen_pt(&self) -> ScreenPt
[src]
pub fn center_to_map_pt(&self) -> Pt2D
[src]
pub fn center_on_map_pt(&mut self, pt: Pt2D)
[src]
pub fn map_to_screen(&self, pt: Pt2D) -> ScreenPt
[src]
fn get_inner_bounds(&self) -> Bounds
[src]
pub fn get_window_dims(&self) -> ScreenDims
[src]
fn get_map_bounds(&self) -> Bounds
[src]
pub fn get_screen_bounds(&self) -> Bounds
[src]
pub(crate) fn align_window(
&self,
dims: ScreenDims,
horiz: HorizontalAlignment,
vert: VerticalAlignment
) -> ScreenPt
[src]
&self,
dims: ScreenDims,
horiz: HorizontalAlignment,
vert: VerticalAlignment
) -> ScreenPt