mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 12:12:00 +03:00
cam_zoom doesnt need to be repeated in RenderOptions.
This commit is contained in:
parent
d56f2fad1c
commit
7766c80f25
@ -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!
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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()),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user