Exemple #1
0
 void SpectrumWidget::correctAreaToObeyMinMaxRanges_(SpectrumCanvas::AreaType& area)
 {
   if (area.maxX() > canvas()->getDataRange().maxX())
     area.setMaxX(canvas()->getDataRange().maxX());
   if (area.minX() < canvas()->getDataRange().minX())
     area.setMinX(canvas()->getDataRange().minX());
   if (area.maxY() > canvas()->getDataRange().maxY())
     area.setMaxY(canvas()->getDataRange().maxY());
   if (area.minY() < canvas()->getDataRange().minY())
     area.setMinY(canvas()->getDataRange().minY());
 }
  void Spectrum2DWidget::recalculateAxes_()
  {
    const SpectrumCanvas::AreaType area = canvas()->getVisibleArea();

    if (canvas()->isMzToXAxis())
    {
      x_axis_->setAxisBounds(area.minX(), area.maxX());
      y_axis_->setAxisBounds(area.minY(), area.maxY());
    }
    else
    {
      x_axis_->setAxisBounds(area.minY(), area.maxY());
      y_axis_->setAxisBounds(area.minX(), area.maxX());
    }
  }