fix for #444: Accidentally altering a checkbox.

This commit is contained in:
eshifri
2021-07-19 15:17:31 -07:00
parent 4aade1d0da
commit b951dbf9de
+5 -1
View File
@@ -44,12 +44,16 @@ void CheckBox::onEvent(event_t event)
#if defined(HARDWARE_TOUCH) #if defined(HARDWARE_TOUCH)
bool CheckBox::onTouchEnd(coord_t x, coord_t y) bool CheckBox::onTouchEnd(coord_t x, coord_t y)
{ {
if (enabled) { if (enabled)
{
if (x < (rect.w >> 2))
{
onKeyPress(); onKeyPress();
_setValue(!getValue()); _setValue(!getValue());
setFocus(SET_FOCUS_DEFAULT); setFocus(SET_FOCUS_DEFAULT);
invalidate(); invalidate();
} }
}
return true; return true;
} }
#endif #endif