File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ examples/multiple_figs_demo.py
235235examples/object_picker.py
236236examples/pcolor_demo.py
237237examples/pcolor_demo2.py
238+ examples/pcolor_demo_with_scale.py
238239examples/pcolor_small.py
239240examples/psd_demo.py
240241examples/pstest.py
@@ -391,6 +392,7 @@ matplotlib/backends/backend_gtkagg.py
391392matplotlib/backends/backend_gtkgd.py
392393matplotlib/backends/backend_paint.py
393394matplotlib/backends/backend_ps.py
395+ matplotlib/backends/backend_svg.py
394396matplotlib/backends/backend_template.py
395397matplotlib/backends/backend_tkagg.py
396398matplotlib/backends/backend_wx.py
@@ -399,7 +401,6 @@ matplotlib/backends/tkagg.py
399401src/_backend_agg.cpp
400402src/_backend_agg.h
401403src/_gtkagg.cpp
402- src/_gtkaggold.cpp
403404src/_gtkgd.c
404405src/_image.cpp
405406src/_image.h
Original file line number Diff line number Diff 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
206209Py::Object
Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments