Skip to content
New issue

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

Enhancement/waveform customizations #22

Merged
merged 11 commits into from Apr 13, 2022

Conversation

rutvik110
Copy link
Owner

@rutvik110 rutvik110 commented Apr 13, 2022

Updates :

Rectangle Waveform :

Two new customization options called isRoundedRectangle[bool] and isCentered[bool] added to RectangleWaveform Api.

isRoundedRectangle : If true then rounded rectangles are drawn instead of regular rectangles.
final bool isRoundedRectangle;

isCentered : If true then rectangles are centered along the Y-axis with respect to their center along their height. If [absolute] is true then this would've no effect.

Removed redundant RepaintBoundary wrapper :
Removed redundant RepaintBoundary wrapper around active waveforms and activeinactive waveform CustomPainters. This was done to avoid increase in memory usage as RepaintBoundary would catch the subtree. In case of active/inactivewaveforms, the subtree is changing constantly so the caching was done every frame thus increasing memory usage.

shouldRepaint logic in abstract CustomPainter classes:

Extracted shouldRepaint logic into its separate method to calculate whether to repaint or not. Advantage being, this method in abstract classes can be used within subclasses which may have more arguments that change but doesn't pass those to abstract class and can be used directly without duplicating code for shouldRepaint logic of abstract class.

around activewaveforms and activeinactive waveform types.
Reason being, as active waveform is always changing and not static unlike inactive waveform, so there's no need for RepaintBoundary there. Having RepaintBoundary on active waveoform would lead to increased in memory usage as every frame will be cached for active waveform as it changes.
…height with respect to theirs height along y axis
@rutvik110 rutvik110 merged commit 7e5ff32 into master Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant