If the AbsoluteMax doesn't match the screen resolution then the touch
position passed in to FindMainMenuItem is totally wrong
break;
}
} else { //react to touch event
- UINTN Item = FindMainMenuItem(Screen, &State, TouchState.CurrentX, TouchState.CurrentY);
+ //the TouchProtocol min/max may not match the screen size
+ UINT32 TouchScreenPosX = (TouchState.CurrentX * UGAWidth) / TouchProtocol->Mode->AbsoluteMaxX;
+ UINT32 TouchScreenPosY = (TouchState.CurrentY * UGAHeight) / TouchProtocol->Mode->AbsoluteMaxY;
+
+ UINTN Item = FindMainMenuItem(Screen, &State, TouchScreenPosX, TouchScreenPosY);
switch (Item) {
case TOUCH_NO_ITEM:
//do nothing