Skip to content

Commit

Permalink
Merge pull request #815 from vasole/picking
Browse files Browse the repository at this point in the history
Correct picking error on McaCalWidget
  • Loading branch information
vasole authored Nov 8, 2021
2 parents 3633db2 + f5d2768 commit 40a489d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions PyMca5/PyMcaGraph/backends/MatplotlibBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The PyMca X-Ray Fluorescence Toolkit
#
# Copyright (c) 2004-2020 European Synchrotron Radiation Facility
# Copyright (c) 2004-2021 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
Expand Down Expand Up @@ -639,7 +639,7 @@ def onMousePressed(self, event):
xData, yData = artist._constraint(xData, yData)
artist.set_xdata(xData)
artist.set_ydata(yData)
if BLITTING:
if BLITTING and hasattr(artist.figure, "canvas"):
canvas = artist.figure.canvas
axes = artist.axes
artist.set_animated(True)
Expand Down Expand Up @@ -679,6 +679,8 @@ def onMousePressed(self, event):
else:
ddict['button'] = "right"
self._callback(ddict)
if ddict['event'] == "markerClicked":
self.__picking = False
return
elif self._pickingInfo['type'] == "curve":
ddict = {}
Expand Down Expand Up @@ -1112,6 +1114,7 @@ def onMouseReleased(self, event):
ddict['xdata'] = artist.get_xdata()
ddict['ydata'] = artist.get_ydata()
self._callback(ddict)
self._pickingInfo = {}
return

if not hasattr(self, "__zoomstack"):
Expand Down

0 comments on commit 40a489d

Please sign in to comment.