Allows custom scaling and orientation of the Grid.
Breaking Change
This PR introduces a breaking change as it changes the parameter list for Grid::new(). The new grid works a bit differently from the old one; Grids are now limited to being either vertically or horizontally aligned. Also, a scaling has to be given
Here's how to adapt a grid to this new system (from the peak meter in the visualizers example)
You will also have to layer two Grids to get both vertical and horizontal grid lines.
Example
This new system, although slightly more tedious to work with, grants you more control when it comes to the layout, scaling, and style of your grids. For example, here's the spectrum analyzer's grid from the visualizers example.
Allows custom scaling and orientation of the
Grid
.Breaking Change
This PR introduces a breaking change as it changes the parameter list for
Grid::new()
. The new grid works a bit differently from the old one; Grids are now limited to being either vertically or horizontally aligned. Also, a scaling has to be givenHere's how to adapt a grid to this new system (from the peak meter in the
visualizers
example)You will also have to layer two
Grid
s to get both vertical and horizontal grid lines.Example
This new system, although slightly more tedious to work with, grants you more control when it comes to the layout, scaling, and style of your grids. For example, here's the spectrum analyzer's grid from the
visualizers
example.The first grid shows grid lines for each of the supplied frequencies (20Hz, 40Hz, ..., 20000Hz)
ValueScaling::Frequency
The second grid shows grid lines for each of the supplied magnitudes (0dB, -10dB, ..., -70dB)
ValueScaling::Linear
The magnitude grid is also more faint than the frequency grid. They're in a
ZStack
, above theSpectrumAnalyzer
.