drawing sequence basepairs.
[mussa.git] / qui / PathScene.cxx
index 759014ec6835ddcb5e61107d6f7833c8bf2c0846..e97429cef7d0285f8551d89ba8dbc7d83f4fcdf4 100644 (file)
@@ -19,7 +19,8 @@ using namespace std;
 
 PathScene::PathScene(Mussa* analysis, QWidget *parent) : 
   QGLWidget(parent),
-  X(0),
+  viewport_height(0),
+  viewport_width(0),
   clipZ(30.0),
   zoom(0),
   maxOrtho2d(-50.0, -50, 3000000.0, 300.0),
@@ -44,14 +45,6 @@ QSize PathScene::sizeHint() const
   return QSize(400, 400);
 }
 
-void PathScene::setX(int newX)
-{
-  if (X != newX) {
-    X = newX;
-    update();
-  }
-}
-
 static float max(float a, float b)
 {
   if ( a < b) 
@@ -178,6 +171,10 @@ void PathScene::initializeGL()
 
 void PathScene::resizeGL(int width, int height)
 {
+  viewport_width = width;
+  viewport_height = height;
+  assert (geometry().width() == width);
+  assert (geometry().height() == height);
   glViewport(0, 0, (GLsizei)width, (GLsizei)height);
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
@@ -379,7 +376,7 @@ void PathScene::draw_tracks() const
   for (vector<GlSequence>::size_type i = 0; i != tracks.size(); ++i )
   {
     glLoadName(i);
-    tracks[i].draw();
+    tracks[i].draw(curOrtho2d.left(), curOrtho2d.right());
   }
   glPopName();
   glPopMatrix();
@@ -486,4 +483,3 @@ void PathScene::mussaesque()
   glPopName();
 }
 
-