diff --git a/src/surge-xt/gui/overlays/MSEGEditor.cpp b/src/surge-xt/gui/overlays/MSEGEditor.cpp index 6c49752b9dd..1282a179f74 100644 --- a/src/surge-xt/gui/overlays/MSEGEditor.cpp +++ b/src/surge-xt/gui/overlays/MSEGEditor.cpp @@ -1683,6 +1683,7 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp // Lin doesn't cursor hide so this hand is bad there setMouseCursor(juce::MouseCursor::DraggingHandCursor); } + return; } @@ -1690,6 +1691,7 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp { auto ha = getHAxisDoubleClickArea(); auto where = event.position.toInt(); + if (ha.contains(where)) { zoomToFull(); @@ -1714,7 +1716,6 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp { case hotzone::SEGMENT_ENDPOINT: { - if (event.mods.isShiftDown() && h.associatedSegment >= 0) { Surge::MSEG::deleteSegment(ms, ms->segmentStart[h.associatedSegment]); @@ -1723,14 +1724,20 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp { Surge::MSEG::unsplitSegment(ms, t); } + modelChanged(); + repaint(); + return; } case hotzone::SEGMENT_CONTROL: { - // Reset the controlpoint to duration half value middle + // Reset the control point to duration half value middle Surge::MSEG::resetControlPoint(ms, t); + modelChanged(); + repaint(); + return; } case hotzone::LOOP_START: @@ -1751,16 +1758,23 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp { Surge::MSEG::splitSegment(ms, t, v); } + modelChanged(); + repaint(); + return; } else { Surge::MSEG::extendTo(ms, t, v); + modelChanged(); + repaint(); + return; } } + guaranteeCursorShown(); } @@ -1784,6 +1798,7 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp { lassoSelector.reset(nullptr); } + return; } @@ -1818,6 +1833,8 @@ struct MSEGCanvas : public juce::Component, public Surge::GUI::SkinConsumingComp h.active = false; h.dragging = false; + + repaint(); } snapGuard = nullptr; diff --git a/src/surge-xt/gui/widgets/MenuForDiscreteParams.h b/src/surge-xt/gui/widgets/MenuForDiscreteParams.h index db97ed4b761..93bd3794d8b 100644 --- a/src/surge-xt/gui/widgets/MenuForDiscreteParams.h +++ b/src/surge-xt/gui/widgets/MenuForDiscreteParams.h @@ -76,38 +76,59 @@ struct MenuForDiscreteParams : public juce::Component, LEFT, RIGHT } glyphLocation = LEFT; + void setDragGlyph(SurgeImage *d, int boxSize) { dragGlyph = d; dragGlyphBoxSize = boxSize; } + void setDragGlyphHover(SurgeImage *d) { dragGlyphHover = d; } - juce::Rectangle glyphPosition; - void setGlyphMode(bool b) { glyphMode = b; } + juce::Rectangle glyphPosition; bool glyphMode{false}; + SurgeImage *bg{nullptr}, *bghover{nullptr}; + void setGlyphMode(bool b) { glyphMode = b; } void setBackgroundDrawable(SurgeImage *d) { bg = d; } void setHoverBackgroundDrawable(SurgeImage *d) { bghover = d; } - SurgeImage *bg{nullptr}, *bghover{nullptr}; void paint(juce::Graphics &g) override; + bool isHovered{false}; - void mouseEnter(const juce::MouseEvent &e) override + + void mouseEnter(const juce::MouseEvent &event) override { isHovered = true; repaint(); } - void mouseExit(const juce::MouseEvent &e) override + + void mouseMove(const juce::MouseEvent &event) override { - isHovered = false; - repaint(); + if (glyphMode && glyphPosition.contains(event.position)) + { + setMouseCursor(juce::MouseCursor::UpDownResizeCursor); + } + else + { + setMouseCursor(juce::MouseCursor::NormalCursor); + } } + + void mouseExit(const juce::MouseEvent &event) override { endHover(); } + void endHover() override { isHovered = false; + + if (glyphMode) + { + setMouseCursor(juce::MouseCursor::NormalCursor); + } + repaint(); } + juce::Point mouseDownOrigin; bool isDraggingGlyph{false}; float lastDragDistance{0}; diff --git a/src/surge-xt/gui/widgets/WaveShaperSelector.h b/src/surge-xt/gui/widgets/WaveShaperSelector.h index 2ebfda136f0..13a59076344 100644 --- a/src/surge-xt/gui/widgets/WaveShaperSelector.h +++ b/src/surge-xt/gui/widgets/WaveShaperSelector.h @@ -37,16 +37,27 @@ struct WaveShaperSelector : public juce::Component, public WidgetBaseMixin