src/video/windows/SDL_windowsmessagebox.c
changeset 10478 30302a3c5df7
parent 9998 f67cf37e9cd4
child 10737 3406a0f8b041
     1.1 --- a/src/video/windows/SDL_windowsmessagebox.c	Fri Oct 07 16:13:37 2016 -0700
     1.2 +++ b/src/video/windows/SDL_windowsmessagebox.c	Fri Oct 07 16:19:50 2016 -0700
     1.3 @@ -452,9 +452,9 @@
     1.4      }
     1.5  
     1.6      /* Align the buttons to the right/bottom. */
     1.7 -    x = Size.cx - ButtonWidth - ButtonMargin;
     1.8 +    x = Size.cx - (ButtonWidth + ButtonMargin) * messageboxdata->numbuttons;
     1.9      y = Size.cy - ButtonHeight - ButtonMargin;
    1.10 -    for (i = 0; i < messageboxdata->numbuttons; ++i) {
    1.11 +    for (i = messageboxdata->numbuttons - 1; i >= 0; --i) {
    1.12          SDL_bool isDefault;
    1.13  
    1.14          if (buttons[i].flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) {
    1.15 @@ -466,7 +466,7 @@
    1.16              FreeDialogData(dialog);
    1.17              return -1;
    1.18          }
    1.19 -        x -= ButtonWidth + ButtonMargin;
    1.20 +        x += ButtonWidth + ButtonMargin;
    1.21      }
    1.22  
    1.23      /* FIXME: If we have a parent window, get the Instance and HWND for them */