]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
fix: double click on a curve while legend is None was not rendering as expected;...
authorjh777916 <juba.hamma@cea.fr>
Fri, 29 Sep 2023 12:56:13 +0000 (14:56 +0200)
committerjh777916 <juba.hamma@cea.fr>
Fri, 29 Sep 2023 12:56:13 +0000 (14:56 +0200)
tools/CurvePlot/src/cpp/CurvePlot.cxx
tools/CurvePlot/src/cpp/CurvePlot.hxx
tools/CurvePlot/src/python/views/XYView.py

index e94eddff56f2ecd8400c8ae270228ddaf17918a9..0a1f20ecb206bef3b0b08f778de7b76446b7148e 100644 (file)
@@ -477,6 +477,16 @@ namespace CURVEPLOT
     return PyLong_AsLong(ret);
   }
 
+  void CurvePlot::SetCurrentPlotSet(PlotID plot_set_id)
+  {
+    PyLockWrapper lock;
+    PyObject * cont = GetInstance()->_impl->_controller;
+
+    PyObjWrapper ret(
+          PyObject_CallMethod(cont, (char *)"SetCurrentPlotSet", (char *)"i", plot_set_id));
+    HandleAndPrintPyError("CurvePlot::SetCurrentPlotSet(): unexpected error!");
+  }
+
   bool CurvePlot::IsValidPlotSetID(PlotID plot_set_id)
   {
     PyLockWrapper lock;
index 380ea469dbf50019548106e39d91c7e5c59a3da0..d59b9f96133f776b4914ab055f83871c992c3b9e 100644 (file)
@@ -126,6 +126,8 @@ namespace CURVEPLOT
 
     static PlotID GetCurrentPlotSetID();
 
+    static void SetCurrentPlotSet(PlotID plot_set_id=-1);
+
     static void ToggleCurveBrowser(bool with_curve_browser);
 
     static bool IsValidPlotSetID(PlotID plot_set_id=-1);
index 8542983af7a3903b93338e6407a9243044138e88..b90dda21a237bfde7254c74b7491f0cb255e49ae 100644 (file)
@@ -377,7 +377,7 @@ class XYView(View):
       j = xM-xm
       if np.isfinite(xm) and np.isfinite(xM) and np.isfinite(ym) and np.isfinite(yM):
         self._mplAxes.axis([xm-j*self.AUTOFIT_MARGIN, xM+j*self.AUTOFIT_MARGIN,
-                            ym-i*self.AUTOFIT_MARGIN, yM+i*self.AUTOFIT_MARGIN])
+                 ym-i*self.AUTOFIT_MARGIN, yM+i*self.AUTOFIT_MARGIN])
       if repaint:
         self.repaint()
 
@@ -516,7 +516,8 @@ class XYView(View):
       for crv_id, cv in list(self._curveViews.items()):
         if (crv_id != self._currCrv.getID()) :
           cv.setAlpha(0.05)
-      self.showHideLegend() # redo legend
+      self.repaint()
+      self.showHideLegend(repaint=False) # redo legend
     return
 
   def showHideLegend(self, actionChecked=None, repaint=True):