Same as original
Diff: button_group.cpp
- Revision:
- 9:0573d8a9bbcd
- Parent:
- 8:479ed9f0ba20
- Child:
- 11:204bc17f59cc
diff -r 479ed9f0ba20 -r 0573d8a9bbcd button_group.cpp --- a/button_group.cpp Wed Dec 23 07:24:48 2015 +0000 +++ b/button_group.cpp Wed Dec 23 08:00:51 2015 +0000 @@ -67,13 +67,13 @@ // Get touched number and redraw button if touched bool ButtonGroup::GetTouchedNumber(int &num, uint32_t color) { - if ((num<0) || (num>=numberOfButtons_)) return false; - - int tmp = num; if (GetTouchedNumber(num)) { - buttons_[num]->Draw(color); - buttons_[tmp]->Redraw(); + for (int n=0; n<numberOfButtons_; n++) + if (n == num) + buttons_[n]->Draw(color); + else + buttons_[n]->Redraw(); return true; } else