Until there's a faster implementation, just flag-guard selecting unzoomed agents

This commit is contained in:
Dustin Carlino 2020-10-14 13:45:05 -05:00
parent 38394c4a08
commit 4a197fa13d
3 changed files with 11 additions and 0 deletions

View File

@ -51,6 +51,9 @@ pub fn main() {
if args.enabled("--lowzoom") {
opts.min_zoom_for_detail = 1.0;
}
if args.enabled("--select_unzoomed_agents") {
opts.select_unzoomed_agents = true;
}
if let Some(x) = args.optional("--color_scheme") {
let mut ok = false;

View File

@ -29,6 +29,9 @@ pub struct Options {
pub min_zoom_for_detail: f64,
/// Draw buildings in different perspectives
pub camera_angle: CameraAngle,
/// Allow selecting agents when unzoomed. Flagged off by default because the implementation is
/// too slow.
pub select_unzoomed_agents: bool,
/// How much to advance the sim with one of the speed controls
pub time_increment: Duration,
@ -54,6 +57,7 @@ impl Options {
color_scheme: ColorSchemeChoice::Standard,
min_zoom_for_detail: 4.0,
camera_angle: CameraAngle::TopDown,
select_unzoomed_agents: false,
time_increment: Duration::minutes(10),
dont_draw_time_warp: false,

View File

@ -730,6 +730,10 @@ fn mouseover_unzoomed_agent_circle(ctx: &mut EventCtx, app: &mut App) {
// - We could build and cache a quadtree if we're paused
// - We could always build the quadtree as we loop over unzoomed agents
// - At least do this while we draw? Don't call twice.
if !app.opts.select_unzoomed_agents {
return;
}
let cursor = if let Some(pt) = ctx.canvas.get_cursor_in_map_space() {
pt
} else {