Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class RectangleActiveWaveformPainter extends ActiveWaveformPainter {
WaveformAlignment waveformAlignment,
bool isCentered,
) {
final radius = Radius.circular(sampleWidth);
for (var i = 0; i < activeSamples.length; i++) {
if (i.isEven) {
final x = sampleWidth * i;
Expand All @@ -114,21 +115,22 @@ class RectangleActiveWaveformPainter extends ActiveWaveformPainter {
: !isCentered
? alignPosition
: alignPosition - y / 2;
final rectangle = Rect.fromLTWH(x, positionFromTop, sampleWidth, y);

//Draws the filled rectangles of the waveform.
canvas
..drawRRect(
RRect.fromRectAndRadius(
Rect.fromLTWH(x, positionFromTop, sampleWidth, y),
Radius.circular(x),
rectangle,
radius,
),
paint,
)
//Draws the border for the rectangles of the waveform.
..drawRRect(
RRect.fromRectAndRadius(
Rect.fromLTWH(x, positionFromTop, sampleWidth, y),
Radius.circular(x),
rectangle,
radius,
),
borderPaint,
);
Expand Down