summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/graphics.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/graphics.rs b/src/graphics.rs
index e4f8e38..3b08c77 100644
--- a/src/graphics.rs
+++ b/src/graphics.rs
@@ -117,7 +117,7 @@ trait Scene {
}
struct MapScene {
- view: View,
+ map_view: View,
// pan
panning: bool,
pan_start: Vector2f,
@@ -129,7 +129,7 @@ struct MapScene {
impl MapScene {
fn new(window: &RenderWindow) -> MapScene {
return MapScene {
- view: window.default_view().to_owned(),
+ map_view: window.default_view().to_owned(),
panning: false,
pan_start: Vector2f::new(0.0, 0.0),
tilesets: HashMap::new(),
@@ -237,8 +237,8 @@ impl Scene for MapScene {
Event::MouseWheelScrolled { wheel: _, delta, x: _, y: _ } => {
// delta is probalby a value between -1 and 1
let zoom = 1.0 + delta * 0.1;
- self.view.zoom(zoom);
- window.set_view(&self.view);
+ self.map_view.zoom(zoom);
+ window.set_view(&self.map_view);
},
Event::MouseButtonPressed { button, x, y} => {
match button {
@@ -266,8 +266,8 @@ impl Scene for MapScene {
let delta = self.pan_start - window.map_pixel_to_coords_current_view(&Vector2i::new(x, y));
// move view by moving the center by delta
- self.view.move_(delta);
- window.set_view(&self.view);
+ self.map_view.move_(delta);
+ window.set_view(&self.map_view);
}
}
_ => {},