We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rerendering only the visible is enough
The text was updated successfully, but these errors were encountered:
@ty1135 That is what I have done for duration labels but how do suggest to approach this for waveform data?
Sorry, something went wrong.
void paintWave(Canvas canvas, Size size) { // barWidth * (1 + spacingRatio) * pixelsPerSecond * visibleDuration.inSeconds = size.width final visiblePixels = pixelsPerSecond! * visibleDuration.inSeconds; final barWidth = size.width / ((1 + spacingRatio) * visiblePixels); final spacing = barWidth * spacingRatio; // final secondsPerPixel = 1 / pixelsPerSecond!; final microSecondsPerPixel = secondsPerPixel * 1000 * 1000; final index = visibleStart ~/ microSecondsPerPixel;
final remainder = visibleStart % microSecondsPerPixel; final offset = remainder / microSecondsPerPixel * (barWidth + spacing); defaultPaint.strokeWidth = barWidth; if (waveFormData != null) { for (int i = index; i <= index + visiblePixels && i < waveFormData!.length; i++) { double x = (spacing + barWidth) * (i - index) - offset + spacing; Offset bottom = Offset(x, scaleY(waveFormData![2 * i], size.height)); Offset top = Offset(x, scaleY(waveFormData![2 * i + 1], size.height)); canvas.drawLine(bottom, top, defaultPaint); } }
}
Successfully merging a pull request may close this issue.
rerendering only the visible is enough
The text was updated successfully, but these errors were encountered: