Ignore:
Timestamp:
Jan 20, 2001, 12:03:45 AM (25 years ago)
Author:
sandervl
Message:

Get/SetCaretPos fixes

File:
1 edited

Legend:

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

    r4848 r4976  
    1 /* $Id: caret.cpp,v 1.15 2000-12-29 18:39:58 sandervl Exp $ */
     1/* $Id: caret.cpp,v 1.16 2001-01-19 23:03:45 sandervl Exp $ */
    22
    33/*
     
    158158        {
    159159           long height = wnd->getWindowHeight();
    160            caretPos.y = height - caretPos.y - 1;
    161            xNew = caretPos.x;
     160           caretPos.y = height - (caretPos.y + wnd->getClientRectPtr()->top) - 1;
     161           xNew = caretPos.x + wnd->getClientRectPtr()->left;
    162162           yNew = caretPos.y - cursorInfo.cy;
    163163        }
     
    183183   CURSORINFO cursorInfo;
    184184
    185    dprintf(("USER32:  GetCaretPos"));
     185   dprintf(("USER32: GetCaretPos"));
    186186
    187187   if (WinQueryCursorInfo (HWND_DESKTOP, &cursorInfo))
     
    195195         if (wnd && wnd->isOwnDC())
    196196            hps = wnd->getOwnDC();
    197          else
    198          {
    199            return FALSE;
     197
     198         if(wnd == NULL) {
     199            dprintf(("ERROR: GetCaretPos: wnd == NULL!"));
     200            return FALSE;
    200201         }
    201202
     
    207208         }
    208209         else {
    209             long height  = wnd->getWindowHeight();
    210             caretPos.y  += cursorInfo.cy;
    211             cursorInfo.y = height - caretPos.y - 1;
     210            long height   = wnd->getWindowHeight();
     211            caretPos.y   += cursorInfo.cy;
     212            cursorInfo.y  = height - caretPos.y - wnd->getClientRectPtr()->top - 1;
     213            cursorInfo.x -= wnd->getClientRectPtr()->left;
    212214         }
    213215      }
Note: See TracChangeset for help on using the changeset viewer.