OpenCanopy: Do not ASSERT for 0x0 resolution
Fixes
@@ -33,8 +33,8 @@ struct GUI_POINTER_CONTEXT_ {
EFI_ABSOLUTE_POINTER_PROTOCOL *AbsPointer;
APPLE_EVENT_HANDLE AppleEventHandle;
EFI_EVENT AbsPollEvent;
- UINT32 MaxX;
- UINT32 MaxY;
+ UINT32 MaxXPlus1;
+ UINT32 MaxYPlus1;
GUI_PTR_POSITION CurPos;
GUI_PTR_POSITION AbsLastDownPos;
UINT32 OldEventExScale;
@@ -198,14 +198,14 @@ InternalUpdateContextAbsolute (
}
NewX = PointerState.CurrentX - Context->AbsPointer->Mode->AbsoluteMinX;
- NewX *= Context->MaxX + 1;
+ NewX *= Context->MaxXPlus1;
NewPos.Pos.X = (UINT32) DivU64x32 (
NewX,
(UINT32) (Context->AbsPointer->Mode->AbsoluteMaxX - Context->AbsPointer->Mode->AbsoluteMinX)
);
NewY = PointerState.CurrentY - Context->AbsPointer->Mode->AbsoluteMinY;
- NewY *= Context->MaxY + 1;
+ NewY *= Context->MaxYPlus1;
NewPos.Pos.Y = (UINT32) DivU64x32 (
NewY,
(UINT32) (Context->AbsPointer->Mode->AbsoluteMaxY - Context->AbsPointer->Mode->AbsoluteMinY)
@@ -345,13 +345,11 @@ GuiPointerConstruct (
EFI_STATUS Status2;
DIMENSION Dimension;
- ASSERT (DefaultX < Width);
- ASSERT (DefaultY < Height);
- ASSERT (Width <= MAX_INT32);
- ASSERT (Height <= MAX_INT32);
+ ASSERT (DefaultX <= MAX_INT32);
+ ASSERT (DefaultY <= MAX_INT32);
- Context.MaxX = Width - 1;
- Context.MaxY = Height - 1;
+ Context.MaxXPlus1 = Width;
+ Context.MaxYPlus1 = Height;
Context.CurPos.Pos.X = DefaultX;
Context.CurPos.Pos.Y = DefaultY;
Context.UiScale = UiScale;
