@@ -113,10 +113,8 @@ GCAgg::_set_dashes(const Py::Object& gc) {
113
113
// return the dashOffset, dashes sequence tuple.
114
114
_VERBOSE (" GCAgg::_set_dashes" );
115
115
116
- if (dasha != NULL ) {
117
- delete [] dasha;
118
- dasha = NULL ;
119
- }
116
+ delete [] dasha;
117
+ dasha = NULL ;
120
118
121
119
Py::Tuple dashtup = gc.getAttr (" _dashes" );
122
120
@@ -126,21 +124,20 @@ GCAgg::
10000
_set_dashes(const Py::Object& gc) {
126
124
127
125
bool useDashes = dashtup[0 ].ptr () != Py_None;
128
126
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 ;
134
128
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 ];
138
132
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];
140
138
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]);
144
141
145
142
}
146
143
@@ -150,17 +147,14 @@ GCAgg::_set_clip_rectangle( const Py::Object& gc) {
150
147
// set the clip rectangle from the gc
151
148
152
149
_VERBOSE (" GCAgg::set_clip_rectangle" );
153
-
154
-
150
+
155
151
delete [] cliprect;
156
- Py::Object o ( gc. getAttr ( " _cliprect " ) ) ;
152
+ cliprect = NULL ;
157
153
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)
162
156
return ;
163
- }
157
+
164
158
165
159
Py::SeqBase<Py::Object> rect ( o );
166
160
@@ -169,7 +163,6 @@ GCAgg::_set_clip_rectangle( const Py::Object& gc) {
169
163
double w = Py::Float (rect[2 ]) ;
170
164
double h = Py::Float (rect[3 ]) ;
171
165
172
- delete [] cliprect;
173
166
cliprect = new double [4 ];
174
167
cliprect[0 ] = l;
175
168
cliprect[1 ] = b;
@@ -1056,9 +1049,9 @@ RendererAgg::_render_lines_path(agg::path_storage &path, const GCAgg& gc) {
1056
1049
1057
1050
}
1058
1051
1059
- /*
1052
+
1060
1053
Py::Object
1061
- RendererAgg::draw_markers (const Py::Tuple& args) {
1054
+ RendererAgg::_draw_markers (const Py::Tuple& args) {
1062
1055
// draw_markers(gc, path, rgbFace, xo, yo, transform)
1063
1056
theRasterizer->reset_clipping ();
1064
1057
@@ -1178,7 +1171,6 @@ RendererAgg::draw_markers(const Py::Tuple& args) {
1178
1171
1179
1172
}
1180
1173
1181
- */
1182
1174
1183
1175
Py::Object
1184
1176
RendererAgg::draw_markers (const Py::Tuple& args) {
0 commit comments