Preserve camera state in map_editor when appropriate -- makes reloading less jarring
@@ -391,6 +391,7 @@ impl State<App> for MainState {
app.model.map.save();
}
"reload RawMap" => {
+ CameraState::save(&ctx.canvas, &app.model.map.name);
return Transition::Push(crate::load::load_map(
ctx,
abstio::path_raw_map(&app.model.map.name),
@@ -398,6 +399,7 @@ impl State<App> for MainState {
));
}
"open another RawMap" => {
+ CameraState::save(&ctx.canvas, &app.model.map.name);
return Transition::Push(crate::load::PickMap::new_state(ctx));
}
_ => unreachable!(),
