From 07d885a1b6abd0fd4a4761367f415925fe015dd8 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Thu, 6 Jun 2024 14:44:21 -0400 Subject: [PATCH] Add an Arrow L2R with Mul for mod matrix --- include/sst/jucegui/components/GlyphPainter.h | 3 ++- src/sst/jucegui/components/GlyphPainter.cpp | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/sst/jucegui/components/GlyphPainter.h b/include/sst/jucegui/components/GlyphPainter.h index 0394464..07003a7 100644 --- a/include/sst/jucegui/components/GlyphPainter.h +++ b/include/sst/jucegui/components/GlyphPainter.h @@ -58,6 +58,7 @@ struct GlyphPainter : public juce::Component, TUNING, CROSS, ARROW_L_TO_R, + ARROW_L_TO_R_WITH_MUL, METRONOME, JOG_UP, @@ -75,7 +76,7 @@ struct GlyphPainter : public juce::Component, POWER_LIGHT, MUTE, - + MONO, STEREO // the order doesn't matter but we iterate in the demo so // lets leave stereo last diff --git a/src/sst/jucegui/components/GlyphPainter.cpp b/src/sst/jucegui/components/GlyphPainter.cpp index aa18f43..65f7ae5 100644 --- a/src/sst/jucegui/components/GlyphPainter.cpp +++ b/src/sst/jucegui/components/GlyphPainter.cpp @@ -82,7 +82,7 @@ static void paintCrossGlyph(juce::Graphics &g, const juce::Rectangle &into) g.drawLine(0, h, h, 0); } -static void paintArrowLtoR(juce::Graphics &g, const juce::Rectangle &into) +static void paintArrowLtoR(juce::Graphics &g, const juce::Rectangle &into, bool includeMul) { auto sq = into.toFloat().reduced(1, 1); auto cy = sq.getHeight() / 2.f; @@ -91,9 +91,17 @@ static void paintArrowLtoR(juce::Graphics &g, const juce::Rectangle &into) auto grd = juce::Graphics::ScopedSaveState(g); g.addTransform(juce::AffineTransform().translated(sq.getX(), sq.getY())); - g.drawLine(0, cy, sq.getWidth(), cy); + auto wPad = sq.getWidth() * 0.4; + + g.drawLine(includeMul ? wPad : 0, cy, sq.getWidth(), cy); g.drawLine(sq.getWidth(), cy, sq.getWidth() - ah, cy - ah); g.drawLine(sq.getWidth(), cy, sq.getWidth() - ah, cy + ah); + + if (includeMul) + { + g.drawLine(0, cy - wPad * 0.5, wPad, cy + wPad * 0.5); + g.drawLine(0, cy + wPad * 0.5, wPad, cy - wPad * 0.5); + } } static void paintJog(juce::Graphics &g, const juce::Rectangle into, @@ -335,7 +343,11 @@ void GlyphPainter::paintGlyph(juce::Graphics &g, const juce::Rectangle &int return; case ARROW_L_TO_R: - paintArrowLtoR(g, into); + paintArrowLtoR(g, into, false); + return; + + case ARROW_L_TO_R_WITH_MUL: + paintArrowLtoR(g, into, true); return; case JOG_UP: