X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FGUI%2FBaseDiagram.cxx;h=fa593f8b7cdcc5353bdfea0d233173b5914ece1a;hb=4befe0e6ea6b5f21119364f1175a0b6c8e97395c;hp=4204626e502ba9d5037b6f0fc12dfd8661e381c5;hpb=242e79f5e965805879867aac72eb1df32201e54f;p=flightgear.git diff --git a/src/GUI/BaseDiagram.cxx b/src/GUI/BaseDiagram.cxx index 4204626e5..fa593f8b7 100644 --- a/src/GUI/BaseDiagram.cxx +++ b/src/GUI/BaseDiagram.cxx @@ -38,6 +38,8 @@ const float rec = 6378137; // earth radius, equator (?) const float rpol = 6356752.314f; // earth radius, polar (?) +const double MINIMUM_SCALE = 0.002; + //Returns Earth radius at a given latitude (Ellipsoide equation with two equal axis) static float earth_radius_lat( float lat ) { @@ -547,12 +549,16 @@ void BaseDiagram::wheelEvent(QWheelEvent *we) m_wheelAngleDeltaAccumulator += delta; if (m_wheelAngleDeltaAccumulator > 120) { m_wheelAngleDeltaAccumulator = 0; - m_scale *= 2.0; + + m_scale *= 1.5; + } else if (m_wheelAngleDeltaAccumulator < -120) { m_wheelAngleDeltaAccumulator = 0; - m_scale *= 0.5; + + m_scale *= 0.75; } + SG_CLAMP_RANGE(m_scale, MINIMUM_SCALE, 1.0); update(); }