Skip to content

Commit

Permalink
Add bailout to saved state
Browse files Browse the repository at this point in the history
  • Loading branch information
SkwalExe committed Dec 3, 2024
1 parent 88c7295 commit 676b3fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ impl AppState {
.complete((self.render_settings.prec, self.render_settings.prec));
}

// Change the bailout
if let Some(b) = saved.bailout {
self.render_settings.bailout = b;
}

// Change the cell size
if let Some(complex_width) = saved.complex_width {
self.render_settings.set_width(
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/saved_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub(crate) struct SavedState {
pub(crate) void_fill: Option<VoidFill>,
pub(crate) julia_constant: Option<String>,
pub(crate) mandel_constant: Option<String>,
pub(crate) bailout: Option<f32>,
}

impl From<&AppState> for SavedState {
Expand All @@ -31,6 +32,7 @@ impl From<&AppState> for SavedState {
void_fill: Some(void_fills()[state.render_settings.void_fill_index].clone()),
julia_constant: Some(state.render_settings.julia_constant.to_string()),
mandel_constant: Some(state.render_settings.mandel_constant.to_string()),
bailout: Some(state.render_settings.bailout),
}
}
}

0 comments on commit 676b3fa

Please sign in to comment.