Skip to content

Commit ca49de2

Browse files
authored
fix: fix BarVisualizer barBorderRadius and height calculation (#272)
* fix: fix BarVisualizer not respecting barBorderRadius option * fix: correct height calculation for bar visualizer
1 parent a74c941 commit ca49de2

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/components/BarVisualizer.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const BarVisualizer = ({
149149
let bars: React.ReactNode[] = [];
150150
magnitudes.forEach((value, index) => {
151151
let coerced = Math.min(opts.maxHeight, Math.max(opts.minHeight, value));
152-
let coercedPercent = Math.min(100, Math.max(0, coerced * 100 + 5));
152+
let coercedPercent = Math.min(100, Math.max(0, coerced * 100));
153153
let opacity = opacityAnimations[index] ?? new Animated.Value(0.3);
154154
let barStyle = {
155155
opacity: opacity,
@@ -160,11 +160,7 @@ export const BarVisualizer = ({
160160
bars.push(
161161
<Animated.View
162162
key={index}
163-
style={[
164-
{ height: `${coercedPercent}%` },
165-
barStyle,
166-
styles.volumeIndicator,
167-
]}
163+
style={[{ height: `${coercedPercent}%` }, barStyle]}
168164
/>
169165
);
170166
});
@@ -177,9 +173,6 @@ const styles = StyleSheet.create({
177173
alignItems: 'center',
178174
justifyContent: 'space-evenly',
179175
},
180-
volumeIndicator: {
181-
borderRadius: 12,
182-
},
183176
});
184177

185178
export const useBarAnimator = (

0 commit comments

Comments
 (0)