diff --git a/src/gui/CScalableBitmap.h b/src/gui/CScalableBitmap.h index 25356ec2a52..c698be7b45b 100644 --- a/src/gui/CScalableBitmap.h +++ b/src/gui/CScalableBitmap.h @@ -54,7 +54,7 @@ class CScalableBitmap : public VSTGUI::CBitmap */ void setExtraScaleFactor(int a) { extraScaleFactor = a; } - int resourceID; + int resourceID = -1; std::string fname; private: diff --git a/src/gui/widgets/MultiSwitch.cpp b/src/gui/widgets/MultiSwitch.cpp index 7ac1ba95203..384dae4036d 100644 --- a/src/gui/widgets/MultiSwitch.cpp +++ b/src/gui/widgets/MultiSwitch.cpp @@ -97,7 +97,7 @@ void MultiSwitch::mouseDrag(const juce::MouseEvent &event) { int sel = coordinateToSelection(event.x, event.y); hoverSelection = sel; - setValue((float)sel / (rows * columns - 1)); + setValue(limit_range((float)sel / (rows * columns - 1), 0.f, 1.f)); notifyValueChanged(); } }