Commit 338e0166 authored by Thibault Soucarre's avatar Thibault Soucarre

resolve a bug, time was not printed next to vertical line

parent c44b1a64
......@@ -274,12 +274,18 @@ void Render_alternate::paintGL(){
//deselect shader
glUseProgram(0);
QFont arial_font = QFont("Arial", 10);
qglColor(Qt::white);
const QFontMetrics metric(arial_font);
QString t =QString().setNum(vertical_line);
// draw time corresponding to the vertical line position
qglColor(Qt::red);
renderText ( render_to_screen_x(trace_to_render_x(vertical_line))-metric.size(Qt::TextSingleLine,t).width() -5,
metric.height()-1,
t,
arial_font);
qglColor(Qt::white);
//we calculate the height of the interline we want : max height of the font + 1 pixel to avoid overlapping (metric.height() returns a bigger value, a bit too much)
int height = metric.tightBoundingRect("fg").height()+1;
......@@ -826,10 +832,8 @@ void Render_alternate::show_minimap(){
*/
void Render_alternate::draw_vertical_line(){
std::cout << "salut" << vertical_line << std::endl;
if(vertical_line==0)
return;
std::cout << "je sais pas dessiner lol" << std::endl;
double vertex[4] = {trace_to_render_x(vertical_line),
0.0,
trace_to_render_x(vertical_line),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment