Logo Search packages:      
Sourcecode: kdenlive version File versions

void Gui::KFixedRuler::calculateViewport (  )  [private, slot]

Calculates the required values to ensure that startValue is at the start of the ruler, and endValue is at the end of it.

Definition at line 48 of file kfixedruler.cpp.

References margin(), maxValue(), and minValue().

Referenced by setMargin(), and setRange().

                                        {
      int numValues = maxValue() - minValue();
      if (numValues == 0)
          numValues = 1;
      double scale =
          (((double) width() - (2 * margin())) / (double) numValues);
      int firstPixel = (int) (minValue() * scale) - margin();

      setStartPixel(firstPixel);
      setValueScale(scale);
    }


Generated by  Doxygen 1.6.0   Back to index