From 8704b36653dc76ed7b6743642fb2925ffc5789d7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Apr 2005 11:31:55 +0000 Subject: [PATCH] added wxCopyRectToRECT() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/private.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 1b4729ab22..86cc595d89 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -244,15 +244,26 @@ struct WXDLLEXPORT wxCOLORMAP extern wxCOLORMAP *wxGetStdColourMap(); // create a wxRect from Windows RECT -inline wxRect wxRectFromRECT(const RECT& r) +inline wxRect wxRectFromRECT(const RECT& rc) { - return wxRect(r.left, r.top, r.right - r.left, r.bottom - r.top); + return wxRect(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); } // copy Windows RECT to our wxRect -inline void wxCopyRECTToRect(const RECT& r, wxRect& rect) +inline void wxCopyRECTToRect(const RECT& rc, wxRect& rect) { - rect = wxRectFromRECT(r); + rect = wxRectFromRECT(rc); +} + +// and vice versa +inline void wxCopyRectToRECT(const wxRect& rect, RECT& rc) +{ + // note that we don't use wxRect::GetRight() as it is one of compared to + // wxRectFromRECT() above + rc.top = rect.y; + rc.left = rect.x; + rc.right = rect.x + rect.width; + rc.bottom = rect.y + rect.height; } // translations between HIMETRIC units (which OLE likes) and pixels (which are -- 2.45.2