Commit 4c2612e4 authored by Olivier Lagrasse's avatar Olivier Lagrasse

Experiment a new ruler (need some feedbacks)

parent bb52755f
......@@ -253,7 +253,7 @@ void Hook_event::mouseDoubleClickEvent ( QMouseEvent * event ){
void Hook_event::mouseMoveEvent(QMouseEvent * event){
if (!_mouse_pressed) return;
// if (!_mouse_pressed) return;
_new_mouse_x = event->x();
_new_mouse_y = event->y();
......
......@@ -411,7 +411,7 @@ void Render_opengl::paintOverlayGL (){
arial_font);
buf_txt.str("");
buf_txt << (double)Ruler::get_common_part(Info::Render::_x_min_visible, coeff_prefix) << "--";
buf_txt << render_to_trace_x(screen_to_render_x(_new_mouse_x));//(double)Ruler::get_common_part(Info::Render::_x_min_visible, coeff_prefix) << "--";
renderText (render_to_screen_x(
trace_to_render_x(
......@@ -430,7 +430,7 @@ void Render_opengl::paintOverlayGL (){
i+=graduation_diff){
buf_txt.str("");/* flush the buffer */
buf_txt << Ruler::get_variable_part(i, coeff_prefix, 2);
buf_txt << i;//Ruler::get_variable_part(i, coeff_prefix, 2);
renderText (render_to_screen_x(trace_to_render_x(i)+1),
render_to_screen_y(8),
......
......@@ -100,18 +100,18 @@ Element_pos Ruler::get_graduation_diff(const Element_pos min, const Element_pos
diff /= 10; /* Now, diff is within [1;10] */
if (diff > 7){/* Check within ] 7 ; 10 ] */
if (diff > 7){/* Check within ] 7 ; 10 ] */
step = 10;/* 10 trace units between each graduation */
}else if (diff > 3){/* Check within ] 3 ; 7 ] */
}else// if (diff > 3){/* Check within ] 3 ; 7 ] */
step = 5;/* 5 trace units between each graduation */
}else if (diff > 1){/* Check within ] 1 ; 3 ] */
step = 2;/* 2 trace units between each graduation */
// }else //if (diff > 1){/* Check within ] 1 ; 3 ] */
// step = 2;/* 2 trace units between each graduation */
}else{
step = 1;/* 1 trace unit between each graduation */
}
// }else{
// step = 1;/* 1 trace unit between each graduation */
// }
return step*adjust;
}
......
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