r163: *** empty log message ***
[ctsim.git] / libctgraphics / sgp.cpp
index e1a1142e8448a476252010fe899b8cb4614eb8c9..4d70f8cfe965f265f99f06d723542bd7d8603883 100644 (file)
@@ -7,7 +7,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: sgp.cpp,v 1.5 2000/07/28 08:28:08 kevin Exp $
+**  $Id: sgp.cpp,v 1.6 2000/07/28 10:51:31 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
@@ -83,8 +83,11 @@ SGP::SGP (const SGPDriver& driver)
 void
 SGP::stylusNDC (double x, double y, bool beam)
 {
-  int xp = static_cast<int>(x * m_iPhysicalXSize + 0.5);
-  int yp = static_cast<int>(y * m_iPhysicalYSize + 0.5);
+  int xp = static_cast<int>(x * (m_iPhysicalXSize - 1) + 0.5);
+  int yp = static_cast<int>(y * (m_iPhysicalYSize - 1) + 0.5);
+  if (m_driver.isWX())
+    yp = m_iPhysicalYSize - yp;
+
   if (beam) {
       if (m_driver.isWX())
          m_driver.idWX()->DrawLine (m_iCurrentPhysicalX, m_iCurrentPhysicalY, xp, yp);