Skip to content

Commit

Permalink
Fix uninitialized memory for skin resourceID
Browse files Browse the repository at this point in the history
Closes surge-synthesizer#4594

Also limit the rangge of mouse drag on multiswitch so that it doesn't start showing nothing.
  • Loading branch information
mkruselj committed May 24, 2021
1 parent 6d2d609 commit 2cda76a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/CScalableBitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CScalableBitmap : public VSTGUI::CBitmap
*/
void setExtraScaleFactor(int a) { extraScaleFactor = a; }

int resourceID;
int resourceID = -1;
std::string fname;

private:
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/MultiSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 2cda76a

Please sign in to comment.