Fixed invert default behaviour for radial, closes #111

This commit is contained in:
Jarcode
2019-04-02 18:47:04 -07:00
parent a15292be64
commit bf2c5cfcbd
3 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@
#define COLOR (#cc3333 * ((d / 40) + 1))
/* Angle (in radians) for how much to rotate the visualizer */
#define ROTATE (PI / 2)
/* Whether to switch left/right audio buffers */
/* Whether to swap left/right audio buffers, set to 1 to enable */
#define INVERT 0
/* Aliasing factors. Higher values mean more defined and jagged lines.
Note: aliasing does not have a notable impact on performance, but requires

View File

@@ -64,7 +64,7 @@ void main() {
float dir = mod(abs(idx), TWOPI); /* absolute position, [0, 2pi) */
if (dir > PI)
idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */
if (INVERT > 0)
#if INVERT == 0
idx = -idx; /* Invert if needed */
float pos = int(abs(idx) / section) / float(NBARS / 2); /* bar position, [0, 1) */
#define smooth_f(tex) smooth_audio(tex, audio_sz, pos) /* smooth function format */