diff options
author | Picca Frédéric-Emmanuel <picca@debian.org> | 2017-11-25 16:55:20 +0100 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@debian.org> | 2017-11-25 16:55:20 +0100 |
commit | e19c96eff0c310c06c4f268c8b80cb33bd08996f (patch) | |
tree | f2b4a365ed899be04766f3937bcc2d58d22be065 /silx/gui/plot/PlotTools.py | |
parent | bfa4dba15485b4192f8bbe13345e9658c97ecf76 (diff) |
New upstream version 0.6.1+dfsg
Diffstat (limited to 'silx/gui/plot/PlotTools.py')
-rw-r--r-- | silx/gui/plot/PlotTools.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/silx/gui/plot/PlotTools.py b/silx/gui/plot/PlotTools.py index 85dcc31..ed62d48 100644 --- a/silx/gui/plot/PlotTools.py +++ b/silx/gui/plot/PlotTools.py @@ -29,7 +29,7 @@ from __future__ import division __authors__ = ["V.A. Sole", "T. Vincent"] __license__ = "MIT" -__date__ = "02/10/2017" +__date__ = "16/10/2017" import logging @@ -151,13 +151,16 @@ class PositionInfo(qt.QWidget): """ if event['event'] == 'mouseMoved': x, y = event['x'], event['y'] - self._updateStatusBar(x, y) + xPixel, yPixel = event['xpixel'], event['ypixel'] + self._updateStatusBar(x, y, xPixel, yPixel) - def _updateStatusBar(self, x, y): + def _updateStatusBar(self, x, y, xPixel, yPixel): """Update information from the status bar using the definitions. :param float x: Position-x in data :param float y: Position-y in data + :param float xPixel: Position-x in pixels + :param float yPixel: Position-y in pixels """ styleSheet = "color: rgb(0, 0, 0);" # Default style @@ -180,8 +183,6 @@ class PositionInfo(qt.QWidget): closestInPixels = self.plot.dataToPixel( xClosest, yClosest, axis=activeCurve.getYAxis()) if closestInPixels is not None: - xPixel, yPixel = event['xpixel'], event['ypixel'] - if (abs(closestInPixels[0] - xPixel) < 5 and abs(closestInPixels[1] - yPixel) < 5): # Update label style sheet |