From eb9d32bd313267796a1083e5d1e35f8ab4a95762 Mon Sep 17 00:00:00 2001 From: sln Date: Tue, 13 Jan 2009 15:48:02 +0000 Subject: [PATCH] Problem with Fit Area functionality when coordinates more than 1000. setZoomBase() method is added in Plot2d. It update initial zoomer structure. This method is called from onViewFitArea() slots to reinitialize zoomer in accordance with current plot 2d state --- src/Plot2d/Plot2d_ViewFrame.cxx | 11 +++++++++++ src/Plot2d/Plot2d_ViewFrame.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index d4152dd04..62cbb3c6e 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -1704,6 +1704,7 @@ void Plot2d_ViewFrame::onViewFitArea() myPlot->canvas()->setCursor( QCursor( Qt::PointingHandCursor ) ); myOperation = FitAreaId; myPlot->setPickerMousePattern( Qt::LeftButton ); + myPlot->setZoomBase(); } /*! View operations : Global panning @@ -2106,6 +2107,16 @@ int Plot2d_Plot2d::curveNbMarkers( Plot2d_Curve* curve ) const return aPlotCurve ? aPlotCurve->nbMarkers() : 0; } +/*! + Update initial zoomer structure. This method is called from onViewFitArea() + slots to reinitialize zoomer in accordance with current plot 2d state +*/ +void Plot2d_Plot2d::setZoomBase( const bool doReplot ) +{ + if ( myPlotZoomer ) + myPlotZoomer->setZoomBase( doReplot ); +} + /*! Checks if marker belongs to any enitity */ diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 324220ff2..8931a9171 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -247,6 +247,8 @@ public: bool setCurveNbMarkers( Plot2d_Curve* curve, const int nb ); int curveNbMarkers( Plot2d_Curve* curve ) const; + void setZoomBase( const bool doReplot = true ); + public slots: virtual void polish(); -- 2.39.2