Commit 73b4caa6 authored by Augustin Degomme's avatar Augustin Degomme
Browse files

displays timestamp for vertical line inside ruler, and handle zoom better

parent 546c56fa
......@@ -290,14 +290,16 @@ void Render_opengl::paintGL(){
draw_stored_circles();
if (Info::Render::_vertical_line){
draw_vertical_line();
}
/* Untranslate ruler */
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
call_ruler();
glDisable(GL_BLEND);
if (Info::Render::_vertical_line){
draw_vertical_line();
}
}
glPopMatrix();
......@@ -372,14 +374,14 @@ void Render_opengl::paintGL(){
QFont arial_font = QFont("Arial", 10);
qglColor(Qt::white);
const QFontMetrics metric(arial_font);
/* Draw container text */
const unsigned int texts_size = _texts.size();
std::map<Element_pos,Element_pos> previous_by_column;
//int skipped,displayed=0;
for (unsigned int i=0 ; i<texts_size ; i++){
const QFontMetrics metric(arial_font);
const QString text_elided = metric.elidedText(_texts[i].value.c_str(), Qt::ElideRight, _x_scale_container_state*Info::Screen::width/(Info::Trace::depth+1.));
if (trace_to_render_y(_texts[i].y) + 0.5 < 9) continue;/* Do not display text if it is on the ruler area */
......@@ -388,7 +390,8 @@ void Render_opengl::paintGL(){
const std::map<Element_pos,Element_pos>::const_iterator it_end = previous_by_column.end();
if (it==it_end || (trace_to_render_y(_texts[i].y) - trace_to_render_y((*it).second)>2)){
renderText ( render_to_screen_x(_texts[i].x * _x_scale_container_state/0.20),
const QString text_elided = metric.elidedText(_texts[i].value.c_str(), Qt::ElideRight, _x_scale_container_state*Info::Screen::width/(Info::Trace::depth+1.));
renderText ( render_to_screen_x(_texts[i].x * _x_scale_container_state/0.20),
render_to_screen_y( trace_to_render_y(_texts[i].y) + 0.5),
text_elided,
arial_font);
......@@ -1177,10 +1180,11 @@ void Render_opengl::draw_vertical_line(){
}
glPopMatrix();
QFont arial_font = QFont("Arial", 10);
const QFontMetrics metric(arial_font);
QString t =QString().setNum(vertical_line);
// draw time
renderText ( render_to_screen_x(trace_to_render_x(vertical_line))-(t.size()*7),
render_to_screen_y( trace_to_render_y(0) + 2),
metric.height()-1,
t,
arial_font);
......
Supports Markdown
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