Commit 2615647b authored by Olivier Lagrasse's avatar Olivier Lagrasse
Browse files

- Amelioration de la precision lorsque les unites de la regle s'effacent

juste avant de passer sur le rectangle en haut a gauche.
parent fe0500b8
......@@ -1560,24 +1560,24 @@ void Render_opengl::call_ruler(){
/* trunc the common part of each number */
buf_d = buf_time*pow_10_degree_d;
buf_time = buf_d - floor( buf_d );
buf_d = buf_d - floor( buf_d );
/* Mul buf_time to belongs to ]1000;0[ */
buf_time *= mul_scale;
buf_d *= mul_scale;
/* Keep the entire part only */
buf_time = floor(buf_time);
buf_d = floor(buf_d);
/* Finally, fill the text buffer to display the graduate value */
buf_txt << buf_time;
buf_txt << buf_d;
/*
* Display the graduation time value.
*/
glRasterPos2f( - (int)_x_state_translate % (int)_ruler_distance + i*_ruler_distance, _ruler_y+_ruler_height);/* set position */
if ( (10) < (i*_ruler_distance) ){
if ( _info_degree_width < ( i*_ruler_distance - ((int)_x_state_translate % (int)_ruler_distance)) ){
for(unsigned int j = 0 ; j < buf_txt.str().length() ; j ++){
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, buf_txt.str().c_str()[j]);
}
......
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