Enhancement/waveform customizations #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates :
Rectangle Waveform :
Two new customization options called
isRoundedRectangle
[bool] andisCentered
[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.