summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Michelotti <michelotti.matthew@gmail.com>2018-05-05 17:08:05 -0500
committerMatthew Michelotti <michelotti.matthew@gmail.com>2018-05-05 17:08:05 -0500
commit81a1a5c4b9b897539c65348d95edaf31e28e2154 (patch)
tree9324efc6cc56c4e329b272a641559e11572ba69c
parentfe0b51142791395171dae84808533a45407bcd7b (diff)
hid redundant app_dims method in renderer
-rw-r--r--example/src/main.rs4
-rw-r--r--gate/src/renderer/renderer.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/example/src/main.rs b/example/src/main.rs
index 7891720..66ff9e5 100644
--- a/example/src/main.rs
+++ b/example/src/main.rs
@@ -94,8 +94,8 @@ impl App<AssetId> for TowerGame {
}
}
- fn render(&mut self, renderer: &mut Renderer<AssetId>, _ctx: &AppContext<AssetId>) {
- let (app_width, app_height) = renderer.app_dims();
+ fn render(&mut self, renderer: &mut Renderer<AssetId>, ctx: &AppContext<AssetId>) {
+ let (app_width, app_height) = ctx.dims();
{ // drawing tiles
let mut renderer = renderer.tiled_mode(0.5 * app_width, 0.5 * app_height);
for x in 0..((app_width / 16.).ceil() as usize) {
diff --git a/gate/src/renderer/renderer.rs b/gate/src/renderer/renderer.rs
index acf9bb5..530f39b 100644
--- a/gate/src/renderer/renderer.rs
+++ b/gate/src/renderer/renderer.rs
@@ -65,7 +65,7 @@ impl<A: AppAssetId> Renderer<A> {
TiledRenderer { r: self, camera: (camera_x, camera_y) }
}
- pub fn app_dims(&self) -> (f64, f64) { self.b.dims.app_dims }
+ pub(crate) fn app_dims(&self) -> (f64, f64) { self.b.dims.app_dims }
pub(crate) fn to_app_pos(&self, raw_x: i32, raw_y: i32) -> (f64, f64) {
self.b.dims.to_app_pos(raw_x, raw_y)