From: Kevin Hock Date: Wed, 16 Mar 2005 05:31:13 +0000 (+0000) Subject: Allow using negative angles with DrawRotatedText. [ patch 1162771 ] X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c2cb80c865778f940f254544a42dbb4bb2e9cae0 Allow using negative angles with DrawRotatedText. [ patch 1162771 ] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 7ae955a594..d77ba5460c 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1672,6 +1672,8 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, int i_angle = (int) angle; i_angle = i_angle % 360; + if (i_angle < 0) + i_angle += 360; int xoffset = 0; if ((i_angle >= 90.0) && (i_angle < 270.0)) xoffset = image.GetWidth(); diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 7ae955a594..d77ba5460c 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1672,6 +1672,8 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, int i_angle = (int) angle; i_angle = i_angle % 360; + if (i_angle < 0) + i_angle += 360; int xoffset = 0; if ((i_angle >= 90.0) && (i_angle < 270.0)) xoffset = image.GetWidth();