COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 08-03-2018, 12:52 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,137
Default WDL/SWELL: GetWindowRect and flipped coordinates

swell-function.h states:
Code:
/*
** Notes: common win32 code like this:
**   RECT r;
**   GetWindowRect(hwnd,&r); 
**   ScreenToClient(otherhwnd,(LPPOINT)&r);
**   ScreenToClient(otherhwnd,((LPPOINT)&r)+1);
** does work, however be aware that in certain instances r.bottom may be less 
** than r.top, due to flipped coordinates. SetWindowPos and other functions 
** handle negative heights gracefully, and you should too.
**
** Note: GetWindowContentViewRect gets the rectangle of the content view (pre-NCCALCSIZE etc)
*/
* I couldn't find reference to "flipped coordinates" in the standard Win32 API. Are flipped coordinates unique to WDL/SWELL?

* In standard Win32 rects, the pixel whose coordinates are ( right, bottom ) lies immediately *outside* of the rectangle.

If the coordinates are flipped, which are inside the actual rectangle and which are outside?

For example, if r.bottom < r.top, are both pixels now outside the rectangle, with (left,top) sticking out at the bottom of the rectangle and (right,bottom) sticking out to the right?

* Can the rect also be flipped horizontally so that r.right < r.left?

* If the coordinates are flipped, how are ScreenToClient and ClientToScreen calculated? Relative to the flipped (r.left, r.top), or to the actual left, top corner of the rect [which is either (r.left, r.bottom) or (r.left, r.bottom-1), depending on whether r.bottom is always outside the rect]?

Last edited by juliansader; 08-03-2018 at 01:12 AM.
juliansader is online now   Reply With Quote
Old 10-01-2018, 10:37 AM   #2
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,137
Default

Hoping that Justin sees this thread...
juliansader is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.