cam_zoom doesnt need to be repeated in RenderOptions.

This commit is contained in:
Dustin Carlino 2018-12-24 18:14:47 -08:00
parent d56f2fad1c
commit 7766c80f25
5 changed files with 3 additions and 5 deletions

View File

@ -590,5 +590,5 @@ Plugin styles are blocking or ambient. And some can conflict...
- can we somehow fold PluginsPerMap into PerMapUI? :D different API that doesnt blindly pass in all of primary field
- Layers could be stackable modal too, but do that later. low-pri.
- probably dont need all those methods in UIState. just a way to get the main state.
- bulk-disable debug mode stuff in tutorial land. should be easy now!
- dont recreate PluginCtx so many times? changing plugin API or something should help.
- bulk-disable debug mode stuff in tutorial land. should be easy now!

View File

@ -63,7 +63,7 @@ impl Renderable for DrawIntersection {
});
g.draw_polygon(color, &self.polygon);
if opts.cam_zoom >= MIN_ZOOM_FOR_MARKINGS {
if ctx.canvas.cam_zoom >= MIN_ZOOM_FOR_MARKINGS {
for corner in &self.sidewalk_corners {
g.draw_polygon(ctx.cs.get_def("sidewalk corner", Color::grey(0.7)), corner);
}

View File

@ -117,7 +117,7 @@ impl Renderable for DrawLane {
});
g.draw_polygon(color, &self.polygon);
if opts.cam_zoom >= MIN_ZOOM_FOR_MARKINGS {
if ctx.canvas.cam_zoom >= MIN_ZOOM_FOR_MARKINGS {
for m in &self.markings {
m(g, ctx.cs);
}

View File

@ -54,7 +54,6 @@ pub struct RenderOptions {
// The "main" color for the object, if available.
pub color: Option<Color>,
// TODO This should be accessible through ctx...
pub cam_zoom: f64,
pub debug_mode: bool,
pub is_selected: bool,
}

View File

@ -238,7 +238,6 @@ impl<S: UIState> GUI<RenderingHints> for UI<S> {
{
let opts = RenderOptions {
color: self.color_obj(obj.get_id(), &ctx),
cam_zoom: self.canvas.cam_zoom,
debug_mode: self.state.is_debug_mode_enabled(),
is_selected: self.state.is_current_selection(obj.get_id()),
};