Ignore:
Timestamp:
Jun 8, 2000, 8:10:12 PM (25 years ago)
Author:
sandervl
Message:

lots of fixes + changes (see ChangeLog)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibgdi.cpp

    r3662 r3679  
    1 /* $Id: oslibgdi.cpp,v 1.12 2000-06-07 14:51:26 sandervl Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.13 2000-06-08 18:10:10 sandervl Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    121121}
    122122//******************************************************************************
     123//Win32 rectangle in client coordinates (relative to upper left corner of client window)
     124//Convert to frame coordinates (relative to lower left corner of window)
    123125//******************************************************************************
    124126BOOL mapWin32ToOS2RectClientToFrame(Win32BaseWindow *window, PRECT rectWin32,PRECTLOS2 rectOS2)
     
    138140  rectOS2->yBottom = height - (rectWin32->bottom + yclientorg);
    139141  rectOS2->yTop    = height - (rectWin32->top + yclientorg);
    140   rectOS2->xLeft   = rectWin32->left  - xclientorg;
    141   rectOS2->xRight  = rectWin32->right - xclientorg;
     142  rectOS2->xLeft   = rectWin32->left  + xclientorg;
     143  rectOS2->xRight  = rectWin32->right + xclientorg;
     144
     145  return TRUE;
     146}
     147//******************************************************************************
     148//OS/2 rectangle in frame coordinates (relative to lower left corner of window)
     149//Convert to client coordinates (relative to upper left corner of client window)
     150//Note: win32 rectangle can be bigger than client area!
     151//******************************************************************************
     152BOOL mapOS2ToWin32RectFrameToClient(Win32BaseWindow *window, PRECTLOS2 rectOS2,
     153                                    PRECT rectWin32)
     154{
     155 int height;
     156 int xclientorg;
     157 int yclientorg;
     158
     159  if(!window || !rectOS2 || !rectWin32) {
     160        DebugInt3();
     161        return FALSE;
     162  }
     163  height     = window->getWindowHeight();
     164  xclientorg = window->getClientRectPtr()->left;
     165  yclientorg = window->getClientRectPtr()->top;
     166
     167  rectWin32->bottom = height - (rectOS2->yBottom + yclientorg);
     168  rectWin32->top    = height - (rectOS2->yTop + yclientorg);
     169  rectWin32->left   = rectOS2->xLeft  - xclientorg;
     170  rectWin32->right  = rectOS2->xRight - xclientorg;
    142171
    143172  return TRUE;
Note: See TracChangeset for help on using the changeset viewer.