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

Skip to content

Commit 6bd9aa4

Browse files
committed
fixed ticker bug
svn path=/trunk/matplotlib/; revision=327
1 parent ce6bf44 commit 6bd9aa4

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

MANIFEST

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ examples/multiple_figs_demo.py
235235
examples/object_picker.py
236236
examples/pcolor_demo.py
237237
examples/pcolor_demo2.py
238+
examples/pcolor_demo_with_scale.py
238239
examples/pcolor_small.py
239240
examples/psd_demo.py
240241
examples/pstest.py
@@ -391,6 +392,7 @@ matplotlib/backends/backend_gtkagg.py
391392
matplotlib/backends/backend_gtkgd.py
392393
matplotlib/backends/backend_paint.py
393394
matplotlib/backends/backend_ps.py
395+
matplotlib/backends/backend_svg.py
394396
matplotlib/backends/backend_template.py
395397
matplotlib/backends/backend_tkagg.py
396398
matplotlib/backends/backend_wx.py
@@ -399,7 +401,6 @@ matplotlib/backends/tkagg.py
399401
src/_backend_agg.cpp
400402
src/_backend_agg.h
401403
src/_gtkagg.cpp
402-
src/_gtkaggold.cpp
403404
src/_gtkgd.c
404405
src/_image.cpp
405406
src/_image.h

src/_transforms.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,16 @@ Bbox::contains(const Py::Tuple &args) {
194194

195195
double x = Py::Float(args[0]);
196196
double y = Py::Float(args[1]);
197-
198-
Interval *ix = intervalx_api();
199-
Interval *iy = intervaly_api();
200-
int b = ix->contains_api(x) && iy->contains_api(y);
201-
delete ix;
202-
delete iy;
203-
return Py::Int(b);
197+
198+
double minx = _ll->xval();
199+
double miny = _ll->yval();
200+
double maxx = _ur->xval();
201+
double maxy = _ur->yval();
202+
203+
int inx = ( (x>=minx) && (x<=maxx) || (x>=maxx) && (x<=minx) );
204+
if (!inx) return Py::Int(0);
205+
int iny = ( (y>=miny) && (y<=maxy) || (y>=maxy) && (y<=miny) );
206+
return Py::Int(iny);
204207
}
205208

206209
Py::Object

src/_transforms.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,6 @@ class Bbox: public Py::PythonExtension<Bbox> {
249249
return Py::Object( new Interval( _ll->y_api(), _ur->y_api()));
250250
}
251251

252-
Interval* intervalx_api() {
253-
return new Interval( _ll->x_api(), _ur->x_api());
254-
}
255-
256-
Interval* intervaly_api() {
257-
return new Interval( _ll->y_api(), _ur->y_api());
258-
}
259252

260253
// update the current bbox with data from xy tuples
261254
Py::Object update(const Py::Tuple &args);

0 commit comments

Comments
 (0)