]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD_scale.cxx
NavDisplay enhancements for Syd.
[flightgear.git] / src / Instrumentation / HUD / HUD_scale.cxx
index 67149d1fbcd81b5c5d5a4f97ceb72084577bf7c7..0ce10c4b6328ef33828da7282fd460dcd78dc814 100644 (file)
 #include "HUD.hxx"
 
 
-//============== Scale class memeber definitions ===============
-//
-// Notes:
-// 1. Scales divide the specified location into half and then
-//    the half opposite the read direction in half again. A bar is
-//    then drawn along the second divider. Scale ticks are drawn
-//    between the middle and quarter section lines (minor division
-//    markers) or just over the middle line.
-//
-// 2.  This class was not intended to be instanciated. See moving_scale
-//     and gauge_instr classes.
-//==============================================================
 HUD::Scale::Scale( HUD *hud, const SGPropertyNode *n, float x, float y) :
     Item(hud, n, x, y),
     _input(n->getNode("input", false)),
-    _major_divs(n->getIntValue("major-divisions")),
-    _minor_divs(n->getIntValue("minor-divisions")),
+    _major_divs(n->getFloatValue("major-divisions")),
+    _minor_divs(n->getFloatValue("minor-divisions")),
     _modulo(n->getIntValue("modulo"))
 {
     if (n->hasValue("display-span"))
@@ -46,13 +34,10 @@ HUD::Scale::Scale( HUD *hud, const SGPropertyNode *n, float x, float y) :
     else
         _range_shown = _input.max() - _input.min();
 
-    scale_factor = (float)get_span() / _range_shown;
+    _display_factor = get_span() / _range_shown;
     if (_range_shown < 0)
         _range_shown = -_range_shown;
 
-//    float temp = (_input.max() - _input.min()) / 100;                // FIXME huh?
-//    if (_range_shown < temp)
-//        _range_shown = temp;
 }