Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae0031d

Browse files
author
Steve Chaplin
committed
'SC'
svn path=/trunk/matplotlib/; revision=1561
1 parent 1a3baf2 commit ae0031d

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
New entries should be added at the top
22

3+
2005-07-24 backend_gtk.py: call FigureCanvasBase.motion_notify_event() on
4+
all motion-notify-events, not just ones where a modifier key or
5+
button has been pressed (fixes bug report from Niklas Volbers) - SC
6+
37
2005-07-24 backend_gtk.py: modify print_figure() use own pixmap, fixing
48
problems where print_figure() overwrites the display pixmap.
59
return False from all button/key etc events - to allow the event

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ def button_release_event(self, x, y, button, guiEvent=None):
742742

743743
def motion_notify_event(self, x, y, guiEvent=None):
744744
"""
745-
Backend derived classes should call this function on any mouse
746-
button release. x,y are the canvas coords: 0,0 is lower, left.
745+
Backend derived classes should call this function on any
746+
motion-notify-event. x,y are the canvas coords: 0,0 is lower, left.
747747
button and key are as defined in MouseEvent
748748
"""
749749
self._lastx, self._lasty = x, y

lib/matplotlib/backends/backend_gtk.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,11 @@ def motion_notify_event(self, widget, event):
181181
if event.is_hint:
182182
x, y, state = event.window.get_pointer()
183183
else:
184-
x = event.x
185-
y = event.y
186-
state = event.state
184+
x, y, state = event.x, event.y, event.state
187185

188186
# flipy so y=0 is bottom of canvas
189-
y = self.figure.bbox.height() - y
190-
191-
if state:
192-
FigureCanvasBase.motion_notify_event(self, x, y)
187+
y = self.allocation.height - y
188+
FigureCanvasBase.motion_notify_event(self, x, y)
193189

194190
return False # finish event propagation?
195191

@@ -225,7 +221,8 @@ def configure_event(self, widget, event):
225221

226222
def draw(self):
227223
self._need_redraw = True
228-
self.expose_event(self, None)
224+
#self.expose_event(self, None)
225+
self.queue_draw()
229226

230227
def draw_idle(self):
231228
def idle_draw(*args):

0 commit comments

Comments
 (0)