remove vestiges of top menu being in the way

This commit is contained in:
Dustin Carlino 2019-04-28 20:07:08 -07:00
parent 8f69d5bbac
commit 2f6cc5fe4d
5 changed files with 7 additions and 20 deletions

View File

@ -110,14 +110,7 @@ impl TurnCyclerState {
sim: &ui.state.primary.sim,
hints: &ui.hints,
};
draw_signal_diagram(
i,
cycle.idx,
Some(time_left),
g.canvas.top_menu_height() + 10.0,
g,
&ctx,
);
draw_signal_diagram(i, cycle.idx, Some(time_left), 0.0, g, &ctx);
}
}
}

View File

@ -1,5 +1,5 @@
use crate::screen_geom::ScreenRectangle;
use crate::{text, ScreenPt, Text, UserInput};
use crate::{ScreenPt, Text, UserInput};
use geom::{Bounds, Pt2D};
use glium_glyph::glyph_brush::rusttype::Scale;
use glium_glyph::GlyphBrush;
@ -166,12 +166,6 @@ impl Canvas {
b
}
// TODO Not super happy about exposing this; fork_screenspace for external callers should be
// smarter.
pub fn top_menu_height(&self) -> f64 {
self.line_height(text::FONT_SIZE)
}
pub fn text_dims(&self, txt: &Text) -> (f64, f64) {
txt.dims(self)
}
@ -198,7 +192,6 @@ pub enum HorizontalAlignment {
pub enum VerticalAlignment {
Top,
BelowTopMenu,
Center,
Bottom,
}

View File

@ -161,7 +161,6 @@ impl<'a> GfxCtx<'a> {
};
let y1 = match vert {
VerticalAlignment::Top => 0.0,
VerticalAlignment::BelowTopMenu => self.canvas.top_menu_height(),
VerticalAlignment::Center => (self.canvas.window_height - height) / 2.0,
VerticalAlignment::Bottom => self.canvas.window_height - height,
};

View File

@ -65,7 +65,7 @@ impl<T: Clone> Menu<T> {
} else {
total_width
};
ScreenPt::new(canvas.window_width - w, canvas.top_menu_height())
ScreenPt::new(canvas.window_width - w, 0.0)
}
};

View File

@ -122,11 +122,13 @@ impl TopMenu {
}
pub fn draw(&self, g: &mut GfxCtx) {
let top_menu_height = g.canvas.line_height(text::FONT_SIZE);
g.canvas.mark_covered_area(ScreenRectangle {
x1: 0.0,
y1: 0.0,
x2: g.canvas.window_width,
y2: g.canvas.top_menu_height(),
y2: top_menu_height,
});
g.fork_screenspace();
@ -135,7 +137,7 @@ impl TopMenu {
&Polygon::rectangle_topleft(
Pt2D::new(0.0, 0.0),
g.canvas.window_width,
g.canvas.top_menu_height(),
top_menu_height,
),
);
g.unfork();