@@ -5,8 +5,8 @@ use super::widgets::clipped_text;
55use crate :: ui:: theme:: { self , Palette } ;
66use crate :: ui:: widgets:: { scroll_delta_lines, scroll_glow:: ScrollGlow } ;
77use crate :: util:: color:: {
8- EPSILON , colors_equal, f32_to_u8, find_segment, lerp_color, sanitize_stop_positions ,
9- sanitize_stop_spreads, with_alpha,
8+ EPSILON , STOP_SPREAD_MAX , STOP_SPREAD_MIN , colors_equal, f32_to_u8, find_segment, lerp_color,
9+ sanitize_stop_positions , sanitize_stop_spreads, with_alpha,
1010} ;
1111use iced:: advanced:: renderer:: { self , Quad } ;
1212use iced:: advanced:: widget:: { Tree , tree} ;
@@ -19,8 +19,6 @@ const SWATCH_SIZE: (f32, f32) = (56.0, 28.0);
1919const GRADIENT_BAR_HEIGHT : f32 = 24.0 ;
2020const MARKER_HEIGHT : f32 = 8.0 ;
2121const MIN_STOP_GAP : f32 = 0.01 ;
22- const MIN_SPREAD : f32 = 0.2 ;
23- const MAX_SPREAD : f32 = 5.0 ;
2422
2523#[ derive( Debug , Clone , Copy , PartialEq ) ]
2624pub enum PaletteEvent {
@@ -155,7 +153,7 @@ impl PaletteEditor {
155153 if index >= self . palette . len ( ) {
156154 return false ;
157155 }
158- let next = spread. clamp ( MIN_SPREAD , MAX_SPREAD ) ;
156+ let next = spread. clamp ( STOP_SPREAD_MIN , STOP_SPREAD_MAX ) ;
159157 if ( self . spreads [ index] - next) . abs ( ) < EPSILON {
160158 return false ;
161159 }
@@ -419,7 +417,7 @@ impl Widget<PaletteEvent, iced::Theme, iced::Renderer> for GradientBar<'_> {
419417 {
420418 let dy = scroll_delta_lines ( * delta) ;
421419 let current = self . spreads . get ( i) . copied ( ) . unwrap_or ( 1.0 ) ;
422- let new_spread = ( current + dy * 0.2 ) . clamp ( MIN_SPREAD , MAX_SPREAD ) ;
420+ let new_spread = ( current + dy * 0.2 ) . clamp ( STOP_SPREAD_MIN , STOP_SPREAD_MAX ) ;
423421 if ( current - new_spread) . abs ( ) >= EPSILON {
424422 shell. publish ( PaletteEvent :: AdjustSpread {
425423 index : i,
0 commit comments