From 6abd9fdbd1caf7521e0376e52bb471988d7b1057 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 19 Nov 2016 18:48:07 +0000
Subject: [PATCH]

---
 contrib/mobile/drawContext.cpp | 36 +++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/contrib/mobile/drawContext.cpp b/contrib/mobile/drawContext.cpp
index b25e6004a3..3968441e6d 100644
--- a/contrib/mobile/drawContext.cpp
+++ b/contrib/mobile/drawContext.cpp
@@ -707,13 +707,13 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
 
   char tmp[256];
 
-	// reduce number of vertical tics if not zoomed enough
-	double ww = _width/(_right-_left)*_scale[0];
-	double hh = _height/(_top-_bottom)*_scale[0];
-	if(hh < 10 && comp == 1){
-		n = 2;
-	}
-	
+  // reduce number of vertical tics if not zoomed enough
+  double ww = _width/(_right-_left)*_scale[0];
+  double hh = _height/(_top-_bottom)*_scale[0];
+  if(hh < 10 && comp == 1){
+    n = 2;
+  }
+
   // draw n tics
   double step = l / (double)(n - 1);
   double value_step = value_l / (double)(n - 1);
@@ -729,6 +729,17 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
                          value_p1[1] + value_t[1] * value_d,
                          value_p1[2] + value_t[2] * value_d};
 
+    // draw tic labels
+    if(comp < 0) // display the length value (ruler-mode, starting at 0)
+      sprintf(tmp, format.c_str(), value_d);
+    else // display the coordinate value
+      sprintf(tmp, format.c_str(), value_p[comp]);
+
+    if(strlen(tmp)){
+      drawString lbl(tmp, 15 * _fontFactor);
+      lbl.draw(r[0], r[1], r[2], ww, hh);
+    }
+
     GLfloat lines[] = {
       (float)p[0], (float)p[1], (float)p[2],
       (float)q[0], (float)q[1], (float)q[2]
@@ -744,17 +755,6 @@ int drawContext::drawTics(drawContext *ctx, int comp, double n, std::string &for
     glDrawArrays(GL_LINES, 0, 2);
     glDisableClientState(GL_VERTEX_ARRAY);
     glDisableClientState(GL_COLOR_ARRAY);
-
-    // draw tic labels
-    if(comp < 0) // display the length value (ruler-mode, starting at 0)
-      sprintf(tmp, format.c_str(), value_d);
-    else // display the coordinate value
-      sprintf(tmp, format.c_str(), value_p[comp]);
-
-    if(strlen(tmp)){
-      drawString lbl(tmp, 15 * _fontFactor);
-      lbl.draw(r[0], r[1], r[2], ww, hh);
-    }
   }
   return n;
 }
-- 
GitLab