+ track_container[path_index]->x();
float seq_end_x = s.end.x
+ track_container[path_index+1]->x();
- // add in length
- float seq_start_x_length = s.start.x
+ if (s.length <= 1) {
+ // use lines for elements of length <=1.
+ // and try to center the line
+ const float offset = 0.5;
+ glBegin(GL_LINES);
+ glVertex3f(seq_start_x+offset, s.start.y, -1);
+ glVertex3f(seq_end_x +offset, s.end.y, -1);
+ glEnd();
+ } else {
+ // otherwise use quads
+ // compute length
+ float seq_start_x_length = s.start.x
+ + s.length
+ + track_container[path_index]->x();
+ float seq_end_x_length = s.end.x
+ s.length
- + track_container[path_index]->x();
- float seq_end_x_length = s.end.x
- + s.length
- + track_container[path_index+1]->x();
- //glBegin(GL_LINES);
- // glVertex3f(seq_start_x, s.start.y, -1);
- // glVertex3f(seq_end_x , s.end.y, -1);
- //glEnd();
-
- glBegin(GL_QUADS);
- glVertex3f(seq_start_x, s.start.y, zdepth);
- glVertex3f(seq_end_x, s.end.y, zdepth);
- glVertex3f(seq_end_x_length, s.end.y, zdepth);
- glVertex3f(seq_start_x_length, s.start.y, zdepth);
- glEnd();
+ + track_container[path_index+1]->x();
+ glBegin(GL_QUADS);
+ glVertex3f(seq_start_x, s.start.y, zdepth);
+ glVertex3f(seq_end_x, s.end.y, zdepth);
+ glVertex3f(seq_end_x_length, s.end.y, zdepth);
+ glVertex3f(seq_start_x_length, s.start.y, zdepth);
+ glEnd();
+ }
// clear the names
glPopName(); glPopName(); glPopName();
}