mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 17:34:58 +03:00
avoid a crash with empty text (happening in building info panels, for example) [rebuild]
This commit is contained in:
parent
6ff0c85a14
commit
9c5ea334e0
@ -409,8 +409,10 @@ impl GeomBatch {
|
||||
}
|
||||
|
||||
pub fn get_dims(&self) -> ScreenDims {
|
||||
// TODO Maybe warn about this happening and avoid in the first place? Sometimes we wind up
|
||||
// trying to draw completely empty text.
|
||||
if self.is_empty() {
|
||||
panic!("Can't get_dims of empty GeomBatch");
|
||||
return ScreenDims::new(0.0, 0.0);
|
||||
}
|
||||
let mut bounds = Bounds::new();
|
||||
for (_, poly) in &self.list {
|
||||
|
Loading…
Reference in New Issue
Block a user