8000 upgraded cxx · matplotlib/matplotlib@08c2695 · GitHub
[go: up one dir, main page]

Skip to content

Commit 08c2695

Browse files
committed
upgraded cxx
svn path=/trunk/matplotlib/; revision=1071
1 parent 6505978 commit 08c2695
File tree

3 files changed

+22
-30
lines changed

3 files changed

+22
-30
lines changed

CHANGELOG

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ New entries should be added at the top
99
2005-03-09 Refactored contour functionality into dedicated module
1010

1111
2005-03-09 Added Eric's contourf updates and Nadia's clabel functionality
12-
- TODO, factor clabel into a dedicated class
1312

1413
2005-03-09 Moved colorbar to figure.Figure to expose it for API developers
1514
- JDH

src/_backend_agg.cpp

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ GCAgg::_set_dashes(const Py::Object& gc) {
113113
//return the dashOffset, dashes sequence tuple.
114114
_VERBOSE("GCAgg::_set_dashes");
115115

116-
if (dasha != NULL) {
117-
delete [] dasha;
118-
dasha = NULL;
119-
}
116+
delete [] dasha;
117+
dasha = NULL;
120118

121119
Py::Tuple dashtup = gc.getAttr("_dashes");
122120

@@ -126,21 +124,20 @@ GCAgg:: 10000 _set_dashes(const Py::Object& gc) {
126124

127125
bool useDashes = dashtup[0].ptr() != Py_None;
128126

129-
if ( useDashes ) {
130-
131-
dashOffset = points_to_pixels(dashtup[0]);
132-
Py::SeqBase<Py::Object> dashSeq;
133-
dashSeq = dashtup[1];
127+
if ( !useDashes ) return;
134128

135-
Ndash = dashSeq.length();
136-
if (Ndash%2 != 0 )
137-
throw Py::ValueError(Printf("dash sequence must be an even length sequence; found %d", Ndash).str());
129+
dashOffset = points_to_pixels(dashtup[0]);
130+
Py::SeqBase<Py::Object> dashSeq;
131+
dashSeq = dashtup[1];
138132

139-
dasha = new double[Ndash];
133+
Ndash = dashSeq.length();
134+
if (Ndash%2 != 0 )
135+
throw Py::ValueError(Printf("dash sequence must be an even length sequence; found %d", Ndash).str());
136+
137+
dasha = new double[Ndash];
140138

141-
for (size_t i=0; i<Ndash; i++)
142-
dasha[i] = points_to_pixels(dashSeq[i]);
143-
}
139+
for (size_t i=0; i<Ndash; i++)
140+
dasha[i] = points_to_pixels(dashSeq[i]);
144141

145142
}
146143

@@ -150,17 +147,14 @@ GCAgg::_set_clip_rectangle( const Py::Object& gc) {
150147
//set the clip rectangle from the gc
151148

152149
_VERBOSE("GCAgg::set_clip_rectangle");
153-
154-
150+
155151
delete [] cliprect;
156-
Py::Object o ( gc.getAttr( "_cliprect" ) );
152+
cliprect = NULL;
157153

158-
if (o.ptr()==Py_None) {
159-
// set clipping to false and return success
160-
delete [] cliprect;
161-
cliprect=NULL;
154+
Py::Object o ( gc.getAttr( "_cliprect" ) );
155+
if (o.ptr()==Py_None)
162156
return;
163-
}
157+
164158

165159
Py::SeqBase<Py::Object> rect( o );
166160

@@ -169,7 +163,6 @@ GCAgg::_set_clip_rectangle( const Py::Object& gc) {
169163
double w = Py::Float(rect[2]) ;
170164
double h = Py::Float(rect[3]) ;
171165

172-
delete [] cliprect;
173166
cliprect = new double[4];
174167
cliprect[0] = l;
175168
cliprect[1] = b;
@@ -1056,9 +1049,9 @@ RendererAgg::_render_lines_path(agg::path_storage &path, const GCAgg& gc) {
10561049

10571050
}
10581051

1059-
/*
1052+
10601053
Py::Object
1061-
RendererAgg::draw_markers(const Py::Tuple& args) {
1054+
RendererAgg::_draw_markers(const Py::Tuple& args) {
10621055
//draw_markers(gc, path, rgbFace, xo, yo, transform)
10631056
theRasterizer->reset_clipping();
10641057

@@ -1178,7 +1171,6 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
11781171

11791172
}
11801173

1181-
*/
11821174

11831175
Py::Object
11841176
RendererAgg::draw_markers(const Py::Tuple& args) {

src/_backend_agg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class GCAgg {
7979
void _set_antialiased( const Py::Object& gc);
8080
};
8181

82-
// the renderer
82+
// th renderer
8383
class RendererAgg: public Py::PythonExtension<RendererAgg> {
8484
typedef std::pair<bool, agg::rgba> facepair_t;
8585
public:
@@ -97,6 +97,7 @@ class RendererAgg: public Py::PythonExtension<RendererAgg> {
9797
Py::Object draw_regpoly_collection(const Py::Tuple& args);
9898
Py::Object draw_lines(const Py::Tuple & args);
9999
Py::Object draw_path(const Py::Tuple & args);
100+
Py::Object _draw_markers(const Py::Tuple & args);
100101
Py::Object draw_markers(const Py::Tuple & args);
101102
Py::Object draw_text(const Py::Tuple & args);
102103
Py::Object draw_image(const Py::Tuple & args);

0 commit comments

Comments
 (0)
0