Skip to content

Commit

Permalink
fix surge-synthesizer#544 Inactive buttons [Linux] (surge-synthesizer…
Browse files Browse the repository at this point in the history
…#588)

Solo, Mute, and other CSwitchControl buttons were inactive on Linux because CScalableBitmap returns size 0,0 for all bitmaps on Linux. This diff doesn't solve that problem but accommodates it by making CSwitchControl work like the other switch controls; using a constructor specified size (in this case the size of the view rectangle) to determine how much to translate the switching image. This makes solo, mute, and others work on Linux.

Closes surge-synthesizer#544 by making those buttons inactive.
  • Loading branch information
rghvdberg authored and baconpaul committed Feb 12, 2019
1 parent fd41c6b commit 40e18d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common/gui/CSwitchControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ CSwitchControl::CSwitchControl(const CRect& size,
{
down = false;
is_itype = false;
}
heightOfSingleImage = size.getHeight();
}

void CSwitchControl::draw(CDrawContext* dc)
{
Expand All @@ -26,7 +27,7 @@ void CSwitchControl::draw(CDrawContext* dc)
}
else
{
CPoint where(0, (down ? (pBackground->getHeight() / 2) : 0));
CPoint where(0, (down ? heightOfSingleImage : 0));
pBackground->draw(dc, size, where, 0xff);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/common/gui/CSwitchControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CSwitchControl : public VSTGUI::CControl

private:
bool down;
float heightOfSingleImage;

CLASS_METHODS(CSwitchControl, VSTGUI::CControl)
};

0 comments on commit 40e18d1

Please sign in to comment.