mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-27 00:12:55 +03:00
only mouseover areas in unzoomed debug mode
This commit is contained in:
parent
d516985437
commit
bb2ce2c2f5
@ -168,19 +168,26 @@ impl UI {
|
|||||||
objects.reverse();
|
objects.reverse();
|
||||||
|
|
||||||
for obj in objects {
|
for obj in objects {
|
||||||
// Don't mouseover areas.
|
// In unzoomed mode, can only mouseover areas
|
||||||
// TODO Might get fancier rules in the future, so we can't mouseover irrelevant things
|
|
||||||
// in intersection editor mode, for example.
|
|
||||||
match obj.get_id() {
|
match obj.get_id() {
|
||||||
ID::Area(_) if !debug_areas => {}
|
ID::Area(_) => {
|
||||||
// Thick roads are only shown when unzoomed, when we don't mouseover at all.
|
if !debug_areas {
|
||||||
ID::Road(_) => {}
|
continue;
|
||||||
_ => {
|
|
||||||
if obj.contains_pt(pt, &self.primary.map) {
|
|
||||||
return Some(obj.get_id());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
// Never mouseover these
|
||||||
|
ID::Road(_) => {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
if ctx.canvas.cam_zoom < MIN_ZOOM_FOR_DETAIL {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if obj.contains_pt(pt, &self.primary.map) {
|
||||||
|
return Some(obj.get_id());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user