r314: ezplot fixes
[ctsim.git] / libctgraphics / sgp.cpp
index 4b2d5dcfea9cf1c52a8211b0a3d656dfd65ef821..a7450936dc65d30d27bcc87d541645bbacca99ce 100644 (file)
@@ -7,7 +7,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: sgp.cpp,v 1.23 2000/12/25 21:54:26 kevin Exp $
+**  $Id: sgp.cpp,v 1.24 2000/12/26 21:13:15 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -532,7 +532,12 @@ SGP::getTextExtent (const char* szText, double* worldW, double* worldH)
   if (m_driver.isWX()) {
     wxString sText (szText);
     wxCoord deviceW, deviceH;
-    m_driver.idWX()->GetTextExtent (sText, &deviceW, &deviceH);
+    m_driver.idWX()->GetTextExtent (sText, &deviceW, &deviceH);\r
+    if (m_dTextAngle == 90 || m_dTextAngle == -90) {\r
+      wxCoord temp = deviceW;\r
+      deviceW = deviceH;\r
+      deviceH = temp;\r
+    }
     *worldW = (xw_max - xw_min) * deviceW / static_cast<double>(m_iPhysicalXSize);;
     *worldH = (yw_max - yw_min) * deviceH / static_cast<double>(m_iPhysicalYSize);
   }