@@ -184,6 +184,7 @@ class Renderer {
184
184
185
185
beginShape ( ...args ) {
186
186
this . currentShape . reset ( ) ;
187
+ this . updateShapeVertexProperties ( ) ;
187
188
this . currentShape . beginShape ( ...args ) ;
188
189
}
189
190
@@ -224,13 +225,24 @@ class Renderer {
224
225
return this ;
225
226
}
226
227
227
- spline ( x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 ) {
228
- this . _pInst . beginShape ( ) ;
229
- this . _pInst . splineVertex ( x1 , y1 ) ;
230
- this . _pInst . splineVertex ( x2 , y2 ) ;
231
- this . _pInst . splineVertex ( x3 , y3 ) ;
232
- this . _pInst . splineVertex ( x4 , y4 ) ;
233
- this . _pInst . endShape ( ) ;
228
+ spline ( ...args ) {
229
+ if ( args . length === 2 * 4 ) {
230
+ const [ x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 ] = args ;
231
+ this . _pInst . beginShape ( ) ;
232
+ this . _pInst . splineVertex ( x1 , y1 ) ;
233
+ this . _pInst . splineVertex ( x2 , y2 ) ;
234
+ this . _pInst . splineVertex ( x3 , y3 ) ;
235
+ this . _pInst . splineVertex ( x4 , y4 ) ;
236
+ this . _pInst . endShape ( ) ;
237
+ } else if ( args . length === 3 * 4 ) {
238
+ const [ x1 , y1 , z1 , x2 , y2 , z2 , x3 , y3 , z3 , x4 , y4 , z4 ] = args ;
239
+ this . _pInst . beginShape ( ) ;
240
+ this . _pInst . splineVertex ( x1 , y1 , z1 ) ;
241
+ this . _pInst . splineVertex ( x2 , y2 , z2 ) ;
242
+ this . _pInst . splineVertex ( x3 , y3 , z3 ) ;
243
+ this . _pInst . splineVertex ( x4 , y4 , z4 ) ;
244
+ this . _pInst . endShape ( ) ;
245
+ }
234
246
return this ;
235
247
}
236
248
0 commit comments