diff --git a/src/common/gui/CSwitchControl.cpp b/src/common/gui/CSwitchControl.cpp index dbf46dc1389..acc92a03937 100644 --- a/src/common/gui/CSwitchControl.cpp +++ b/src/common/gui/CSwitchControl.cpp @@ -10,7 +10,8 @@ CSwitchControl::CSwitchControl(const CRect& size, { down = false; is_itype = false; -} + heightOfSingleImage = size.getHeight(); + } void CSwitchControl::draw(CDrawContext* dc) { @@ -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); } } diff --git a/src/common/gui/CSwitchControl.h b/src/common/gui/CSwitchControl.h index 28c348985b4..ea5081f562c 100644 --- a/src/common/gui/CSwitchControl.h +++ b/src/common/gui/CSwitchControl.h @@ -23,6 +23,7 @@ class CSwitchControl : public VSTGUI::CControl private: bool down; + float heightOfSingleImage; CLASS_METHODS(CSwitchControl, VSTGUI::CControl) };