SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S

1
(2)
2
(5)
3
(7)
4
(1)
5
(2)
6
7
8
(2)
9
(4)
10
(1)
11
12
(2)
13
(3)
14
15
(2)
16
(2)
17
18
19
(3)
20
(5)
21
(5)
22
(1)
23
(2)
24
(1)
25
(1)
26
27
28
29
30
31



Showing 1 results of 1

From: <lee...@us...> - 2010年03月22日 16:47:33
Revision: 8210
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8210&view=rev
Author: leejjoon
Date: 2010年03月22日 16:47:27 +0000 (2010年3月22日)
Log Message:
-----------
fix incorrect rubber band during the zoom mode when mouse the axes
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2010年03月21日 22:02:31 UTC (rev 8209)
+++ trunk/matplotlib/CHANGELOG	2010年03月22日 16:47:27 UTC (rev 8210)
@@ -1,3 +1,6 @@
+2010年03月22日 fix incorrect rubber band during the zoom mode when mouse 
+ leaves the axes. -JJL
+
 2010年03月21日 x/y key during the zoom mode only changes the x/y limits. -JJL
 
 2010年03月20日 Added pyplot.sca() function suggested by JJL. - EF
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年03月21日 22:02:31 UTC (rev 8209)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2010年03月22日 16:47:27 UTC (rev 8210)
@@ -2124,18 +2124,6 @@
 if self._lastCursor != cursors.SELECT_REGION:
 self.set_cursor(cursors.SELECT_REGION)
 self._lastCursor = cursors.SELECT_REGION
- if self._xypress:
- x, y = event.x, event.y
- lastx, lasty, a, ind, lim, trans = self._xypress[0]
-
- if self._zoom_mode == "x":
- x1, y1, x2, y2 = event.inaxes.bbox.extents
- y, lasty = y1, y2
- elif self._zoom_mode == "y":
- x1, y1, x2, y2 = event.inaxes.bbox.extents
- x, lastx = x1, x2
- 
- self.draw_rubberband(event, x, y, lastx, lasty)
 elif (self._active=='PAN' and
 self._lastCursor != cursors.MOVE):
 self.set_cursor(cursors.MOVE)
@@ -2237,12 +2225,14 @@
 and a.get_navigate() and a.can_zoom():
 self._xypress.append(( x, y, a, i, a.viewLim.frozen(), a.transData.frozen()))
 
- id1 = self.canvas.mpl_connect('key_press_event',
+ id1 = self.canvas.mpl_connect('motion_notify_event', self.drag_zoom)
+
+ id2 = self.canvas.mpl_connect('key_press_event',
 self._switch_on_zoom_mode)
- id2 = self.canvas.mpl_connect('key_release_event',
+ id3 = self.canvas.mpl_connect('key_release_event',
 self._switch_off_zoom_mode)
 
- self._ids_zoom = id1, id2
+ self._ids_zoom = id1, id2, id3
 
 self._zoom_mode = event.key
 
@@ -2301,6 +2291,29 @@
 a.drag_pan(self._button_pressed, event.key, event.x, event.y)
 self.dynamic_update()
 
+ def drag_zoom(self, event):
+ 'the drag callback in zoom mode'
+
+ if self._xypress:
+ x, y = event.x, event.y
+ lastx, lasty, a, ind, lim, trans = self._xypress[0]
+
+ # adjust x, last, y, last 
+ x1, y1, x2, y2 = a.bbox.extents
+ x, lastx = max(min(x, lastx), x1), min(max(x, lastx), x2)
+ y, lasty = max(min(y, lasty), y1), min(max(y, lasty), y2)
+ 
+ if self._zoom_mode == "x":
+ x1, y1, x2, y2 = a.bbox.extents
+ y, lasty = y1, y2
+ elif self._zoom_mode == "y":
+ x1, y1, x2, y2 = a.bbox.extents
+ x, lastx = x1, x2
+
+ self.draw_rubberband(event, x, y, lastx, lasty)
+
+
+
 def release_zoom(self, event):
 'the release mouse button callback in zoom to rect mode'
 if not self._xypress: return
@@ -2313,7 +2326,6 @@
 for cur_xypress in self._xypress:
 x, y = event.x, event.y
 lastx, lasty, a, ind, lim, trans = cur_xypress
-
 # ignore singular clicks - 5 pixels is a threshold
 if abs(x-lastx)<5 or abs(y-lasty)<5:
 self._xypress = None
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 1 results of 1

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /