From 4dc76dee16324e3fe5e8fd51bd85a0c9629ab81b Mon Sep 17 00:00:00 2001 From: Dukantic Date: Tue, 8 Jul 2025 22:39:59 +0200 Subject: [PATCH] fix --- src/main.rs | 8 +++----- src/music.rs | 5 +---- src/utils.rs | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9b32a99..6dae70d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ mod polygon_draw; -use iced::widget::text_input::Style; use polygon_draw::Polygon; mod music; @@ -10,12 +9,11 @@ use utils::str_to_sec; use std::fs; -use iced::{Element, window}; +use iced::Element; use iced::{ Font, - font::Family, widget::{ - TextInput, column, text, text_input, + TextInput, column, text, text_input::{Icon, Side}, }, }; @@ -173,7 +171,7 @@ impl MyApp { } } Message::AddPoint => { - self.music.add_Point(self.current_delta); + self.music.add_point(self.current_delta); } } } diff --git a/src/music.rs b/src/music.rs index 97793de..a388f85 100644 --- a/src/music.rs +++ b/src/music.rs @@ -1,6 +1,5 @@ use crate::utils::string_to_polygon; use crate::{polygon_draw::*, utils::string_to_color}; -use iced::Length::Fill; use serde::{Deserialize, Serialize}; use kira::{AudioManager, sound::static_sound::StaticSoundData}; @@ -10,7 +9,6 @@ use iced::widget::canvas; use iced::widget::canvas::Stroke; use iced::widget::canvas::Style; use iced::{Color, Rectangle, Renderer, Theme}; -use iced::{Vector, color}; use std::f32::consts::PI; use std::time::Duration; #[derive(Serialize, Deserialize)] @@ -113,7 +111,7 @@ impl Music { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ADD/REMOVE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - pub fn add_Point(&mut self, delta: f32) { + pub fn add_point(&mut self, delta: f32) { let pos = self .poly_frame .binary_search_by(|(d, _)| d.partial_cmp(&delta).unwrap()) @@ -145,7 +143,6 @@ impl canvas::Program for Music { _cursor: mouse::Cursor, ) -> Vec { let mut frame = canvas::Frame::new(renderer, bounds.size()); - let radius = frame.size().width.min(frame.size().height) / 2.0 - 32.0; let mut toggle_color = true; let padding = 8.; let w = bounds.width - (padding * 2.); diff --git a/src/utils.rs b/src/utils.rs index 781c3dc..a720411 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,5 +1,5 @@ use crate::Polygon; -use iced::{Color, widget::canvas::path::lyon_path::geom::euclid::num::Floor}; +use iced::Color; use kira::sound::static_sound::StaticSoundData; pub fn string_to_color>(s: S) -> Color { match s.as_ref() {