Skip to content

Commit

Permalink
with bug
Browse files Browse the repository at this point in the history
  • Loading branch information
realzhujunhao committed Apr 1, 2023
1 parent 4a8cb8f commit 02da938
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl Application for States {
}
Message::Generate => {
generate_chart(self).unwrap();
std::fs::write("test.svg", &self.svg_bytes).unwrap();
std::fs::write(format!("{}.svg", &self.filename), &self.svg_bytes).unwrap();
}
}
Command::none()
Expand Down
5 changes: 0 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ mod adapt;
fn main() -> iced::Result {
const ICON_BYTES: &'static [u8] = include_bytes!("image/profile.png");
let profile_icon = window::icon::Icon::from_file_data(ICON_BYTES, Some(ImageFormat::Png));
if let Err(_) = profile_icon {
println!("wrong");
} else {
println!("{:?}", ICON_BYTES);
}
let setting: iced::Settings<()> = Settings {
window: window::Settings {
size: (1400, 800),
Expand Down
1 change: 0 additions & 1 deletion src/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::{
use plotters::prelude::*;

pub fn generate_chart<'a>(states: &mut States) -> Result<(), Box<dyn std::error::Error>> {
println!("trig");
let root = SVGBackend::with_string(&mut states.svg_bytes, (640, 480))
.into_drawing_area()
.margin(1, 1, 1, 1);
Expand Down

0 comments on commit 02da938

Please sign in to comment.