mirror of
https://github.com/CrispyPin/julia-fractal-renderer.git
synced 2024-11-22 01:50:27 +01:00
show version in-app
This commit is contained in:
parent
0ce808a250
commit
7a1a78384c
4 changed files with 13 additions and 10 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1231,7 +1231,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "julia-set"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"eframe",
|
||||
"image",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "julia-set"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
|
@ -26,8 +26,8 @@ impl Default for RenderOptions {
|
|||
height: 512,
|
||||
unit_width: 4.0,
|
||||
iterations: 128,
|
||||
cx: -0.8,
|
||||
cy: -0.27,
|
||||
cx: 0.4,
|
||||
cy: -0.2,
|
||||
fill_style: FillStyle::Bright,
|
||||
}
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ impl Default for RenderOptions {
|
|||
pub fn view_point(q: &RenderOptions, image: RgbImage) -> RgbImage {
|
||||
apply_fn(image, q, |x, y| {
|
||||
let len = (Vec2::new(x as f32, y as f32) - Vec2::new(q.cx as f32, q.cy as f32)).length();
|
||||
if len < 0.04 {
|
||||
Some(Rgb([0, 255, 255]))
|
||||
} else if len < 0.05 {
|
||||
if len < 0.03 {
|
||||
Some(Rgb([0, 120, 120]))
|
||||
} else if len < 0.04 {
|
||||
Some(Rgb([255; 3]))
|
||||
} else {
|
||||
None
|
||||
|
|
|
@ -362,9 +362,12 @@ impl eframe::App for JuliaGUI {
|
|||
));
|
||||
}
|
||||
|
||||
if let Some(ms) = self.export_render_ms {
|
||||
ui.label(format!("(took {ms:.2}ms)"));
|
||||
}
|
||||
ui.label(
|
||||
self.export_render_ms
|
||||
.map(|ms| format!("took {ms:.2}ms"))
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
ui.label(format!("version {}", env!("CARGO_PKG_VERSION")));
|
||||
|
||||
if set_cx.changed()
|
||||
|| set_cy.changed() || set_unit_width.changed()
|
||||
|
|
Loading…
Reference in a new issue