mirror of
https://github.com/CrispyPin/julia-fractal-renderer.git
synced 2024-11-10 04:30:25 +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]]
|
[[package]]
|
||||||
name = "julia-set"
|
name = "julia-set"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"eframe",
|
"eframe",
|
||||||
"image",
|
"image",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "julia-set"
|
name = "julia-set"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# 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,
|
height: 512,
|
||||||
unit_width: 4.0,
|
unit_width: 4.0,
|
||||||
iterations: 128,
|
iterations: 128,
|
||||||
cx: -0.8,
|
cx: 0.4,
|
||||||
cy: -0.27,
|
cy: -0.2,
|
||||||
fill_style: FillStyle::Bright,
|
fill_style: FillStyle::Bright,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,9 +36,9 @@ impl Default for RenderOptions {
|
||||||
pub fn view_point(q: &RenderOptions, image: RgbImage) -> RgbImage {
|
pub fn view_point(q: &RenderOptions, image: RgbImage) -> RgbImage {
|
||||||
apply_fn(image, q, |x, y| {
|
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();
|
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 {
|
if len < 0.03 {
|
||||||
Some(Rgb([0, 255, 255]))
|
Some(Rgb([0, 120, 120]))
|
||||||
} else if len < 0.05 {
|
} else if len < 0.04 {
|
||||||
Some(Rgb([255; 3]))
|
Some(Rgb([255; 3]))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
@ -362,9 +362,12 @@ impl eframe::App for JuliaGUI {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(ms) = self.export_render_ms {
|
ui.label(
|
||||||
ui.label(format!("(took {ms:.2}ms)"));
|
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()
|
if set_cx.changed()
|
||||||
|| set_cy.changed() || set_unit_width.changed()
|
|| set_cy.changed() || set_unit_width.changed()
|
||||||
|
|
Loading…
Reference in a new issue