@@ -94,6 +94,10 @@ export const CircularDraggableSlider = forwardRef<
9494 const diameter = 2 * Math . PI * radius ;
9595 const distanceBetweenTwoTicks = diameter / linesAmount ;
9696 const listWidth = diameter ;
97+ const mediumLineHeight =
98+ minLineHeight + ( maxLineHeight - minLineHeight ) / 2 ;
99+ const mediumLineIndexWithinGroup =
100+ bigLineIndexOffset > 1 ? Math . round ( bigLineIndexOffset / 2 ) : null ;
97101
98102 const { runTimer, stopTimer, resetTimer, isTimerEnabled } = useTimer ( {
99103 progress,
@@ -182,30 +186,28 @@ export const CircularDraggableSlider = forwardRef<
182186 ] } >
183187 < Animated . View pointerEvents = "none" >
184188 { new Array ( linesAmount ) . fill ( 0 ) . map ( ( _ , index ) => {
185- // Determine line type based on position
186- const isBigLine = index % bigLineIndexOffset === 0 ;
189+ const groupPosition =
190+ bigLineIndexOffset > 0
191+ ? index % bigLineIndexOffset
192+ : index ;
193+ const isBigLine =
194+ bigLineIndexOffset > 0 && groupPosition === 0 ;
195+ const isMediumLine =
196+ ! isBigLine &&
197+ mediumLineIndexWithinGroup !== null &&
198+ groupPosition === mediumLineIndexWithinGroup ;
187199
188- // Calculate the midpoint between consecutive big lines
189- const midpointOffset = bigLineIndexOffset / 2 ;
190- const isMediumLine = ! isBigLine && index % bigLineIndexOffset === midpointOffset ;
200+ const height = isBigLine
201+ ? maxLineHeight
202+ : isMediumLine
203+ ? mediumLineHeight
204+ : minLineHeight ;
191205
192- // Calculate medium line height as the average of max and min
193- const mediumLineHeight = ( maxLineHeight + minLineHeight ) / 2 ;
194-
195- // Determine height based on line type
196- let height : number ;
197- let color : string ;
198-
199- if ( isBigLine ) {
200- height = maxLineHeight ;
201- color = bigLineColor ;
202- } else if ( isMediumLine ) {
203- height = mediumLineHeight ;
204- color = mediumLineColor ;
205- } else {
206- height = minLineHeight ;
207- color = lineColor ;
208- }
206+ const color = isBigLine
207+ ? bigLineColor
208+ : isMediumLine
209+ ? mediumLineColor
210+ : lineColor ;
209211
210212 return (
211213 < LineTime
@@ -256,4 +258,4 @@ const styles = StyleSheet.create({
256258 position : 'absolute' ,
257259 width : '100%' ,
258260 } ,
259- } ) ;
261+ } ) ;
0 commit comments