]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud_card.cxx
fix ugly aliasing effects in moving scales (caused by integer calculation
[flightgear.git] / src / Cockpit / hud_card.cxx
index ee5fad245c41287b1ccf89c34465f083cba5f36b..b958b2cc0124c0290efc63ea7f36649e8783f21a 100644 (file)
@@ -1,3 +1,8 @@
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <plib/sg.h>
 #include "hud.hxx"
 
@@ -161,10 +166,10 @@ draw( void ) //  (HUD_scale * pscale )
 {
 
     float vmin = 0.0, vmax = 0.0;
-    int marker_xs;
-    int marker_xe;
-    int marker_ys;
-    int marker_ye;
+    float marker_xs;
+    float marker_xe;
+    float marker_ys;
+    float marker_ye;
     int text_x = 0, text_y = 0;
     int lenstr;
     int height, width;
@@ -447,7 +452,7 @@ draw( void ) //  (HUD_scale * pscale )
 
                     if( condition ) {  // Show a tick if necessary
                         // Calculate the location of this tick
-                        marker_ys = scrn_rect.top + FloatToInt(((i - vmin) * factor()/*+.5f*/));
+                        marker_ys = scrn_rect.top + (i - vmin) * factor()/*+.5f*/;
                         // marker_ys = scrn_rect.top + (int)((i - vmin) * factor() + .5);
                         // Block calculation artifact from drawing ticks below min coordinate.
                         // Calculation here accounts for text height.