show version in-app

This commit is contained in:
Crispy 2023-07-14 15:01:23 +02:00
parent 0ce808a250
commit 7a1a78384c
4 changed files with 13 additions and 10 deletions

2
Cargo.lock generated
View file

@ -1231,7 +1231,7 @@ dependencies = [
[[package]]
name = "julia-set"
version = "0.1.0"
version = "1.0.0"
dependencies = [
"eframe",
"image",

View file

@ -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

View file

@ -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

View file

@ -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()