Compare commits

...

2 Commits

Author SHA1 Message Date
Emi Simpson b715155b20
Fixed the FUCKING bug
y'know the one where the progress bar disappeared at many resolutions
2022-01-07 17:39:24 -05:00
Emi Simpson 807289ca46
Only blur the cover when running in release mode
This was taking so much time omg
2022-01-07 17:31:02 -05:00
2 changed files with 10 additions and 7 deletions

View File

@ -2,6 +2,7 @@ use iced::Command;
use core::time::Duration;
use iced::Length;
use iced::Color;
use iced::Point;
use symphonia::core::formats::FormatReader;
use crate::player::PlayerError;
use iced::canvas::event::Status;
@ -111,23 +112,23 @@ impl Program<Message> for (&Controls, Theme) {
let mut background = self.1.text_color;
background.a = 0.2;
frame.fill_rectangle(bounds.position(), bounds.size(), background);
frame.fill_rectangle(Point::ORIGIN, bounds.size(), background);
let mut played_size = bounds.size();
played_size.height *= player.position_percent();
frame.fill_rectangle(bounds.position(), played_size, self.1.text_color);
frame.fill_rectangle(Point::ORIGIN, played_size, self.1.text_color);
},
NoError { player: _, has_device: false } => {
let mut background = self.1.text_color;
background.a = 0.1;
frame.fill_rectangle(bounds.position(), bounds.size(), background);
frame.fill_rectangle(Point::ORIGIN, bounds.size(), background);
},
Error(e) => {
let background = Color {r: 1., g: 0.1, b: 0.1, a: 1.};
frame.fill_rectangle(bounds.position(), bounds.size(), background);
frame.fill_rectangle(Point::ORIGIN, bounds.size(), background);
eprintln!("Error!!! {}", e.to_string());
}
}

View File

@ -40,9 +40,11 @@ impl Editor {
}).unwrap_or_else(|| Theme::default());
let cover = cover.expect("TODO");
let bg_img = DynamicImage::ImageBgra8(
cover.blur((cover.width() / 50) as f32).into_bgra8()
);
#[cfg(not(debug_assertions))]
let cover = cover.blur((cover.width() / 50) as f32);
let bg_img = DynamicImage::ImageBgra8(cover.into_bgra8());
let (controls, cmd) = Controls::new(song);