nl_tokens: Processes the paths
pl_tokens: function drawPaths ( rule , isClip ) { if ( rule === 'stroke' && ! isClip && isStrokeTransparent . call ( this ) ) { return ; } if ( rule !== 'stroke' && ! isClip && isFillTransparent . call ( this ) ) { return ; } var moves = [ ] ; var alpha = this . ctx . globalAlpha ; if ( this . ctx . fillOpacity < 1 ) { alpha = this . ctx . fillOpacity ; } var xPath = this . path ; for ( var i = 0 ; i < xPath . length ; i ++ ) { var pt = xPath [ i ] ; switch ( pt . type ) { case 'begin' : moves . push ( { begin : true } ) ; break ; case 'close' : moves . push ( { close : true } ) ; <mask> ; case 'mt' : moves . push ( { start : pt , deltas : [ ] , abs : [ ] } ) ; break ; case 'lt' : var iii = moves . length ; if ( ! isNaN ( xPath [ i - 1 ] . x ) ) { var delta = [ pt . x - xPath [ i - 1 ] . x , pt . y - xPath [ i - 1 ] . y ] ; if ( iii > 0 ) { for ( iii ; iii >= 0 ; iii -- ) { if ( moves [ iii - 1 ] . close !== true && moves [ iii - 1 ] . begin !== true ) { moves [ iii - 1 ] . deltas . push ( delta ) ; moves [ iii - 1 ] . abs . push ( pt ) ; break ; } } } } break ; case 'bct' : var delta = [ pt . x1 - xPath [ i - 1 ] . x , pt . y1 - xPath [ i - 1 ] . y , pt . x2 - xPath [ i - 1 ] . x , pt . y2 - xPath [ i - 1 ] . y , pt . x - xPath [ i - 1 ] . x , pt . y - xPath [ i - 1 ] . y ] ; moves [ moves . length - 1 ] . deltas . push ( delta ) ; break ; case 'qct' : var x1 = xPath [ i - 1 ] . x + 2.0 / 3.0 * ( pt . x1 - xPath [ i - 1 ] . x ) ; var y1 = xPath [ i - 1 ] . y + 2.0 / 3.0 * ( pt . y1 - xPath [ i - 1 ] . y ) ; var x2 = pt . x + 2.0 / 3.0 * ( pt . x1 - pt . x ) ; var y2 = pt . y + 2.0 / 3.0 * ( pt . y1 - pt . y ) ; var x3 = pt . x ; var y3 = pt . y ; var delta = [ x1 - xPath [ i - 1 ] . x , y1 - xPath [ i - 1 ] . y , x2 - xPath [ i - 1 ] . x , y2 - xPath [ i - 1 ] . y , x3 - xPath [ i - 1 ] . x , y3 - xPath [ i - 1 ] . y ] ; moves [ moves . length - 1 ] . deltas . push ( delta ) ; break ; case 'arc' : moves . push ( { deltas : [ ] , abs : [ ] , arc : true } ) ; if ( Array . isArray ( moves [ moves . length - 1 ] . abs ) ) { moves [ moves . length - 1 ] . abs . push ( pt ) ; } break ; } } var style ; if ( ! isClip ) { if ( rule === 'stroke' ) { style = 'stroke' ; } else { style = 'fill' ; } } else { style = null ; } for ( var i = 0 ; i < moves . length ; i ++ ) { if ( moves [ i ] . arc ) { var arcs = moves [ i ] . abs ; for ( var ii = 0 ; ii < arcs . length ; ii ++ ) { var arc = arcs [ ii ] ; if ( typeof arc . startAngle !== 'undefined' ) { var start = rad2deg ( arc . startAngle ) ; var end = rad2deg ( arc . endAngle ) ; var x = arc . x ; var y = arc . y ; drawArc . call ( this , x , y , arc . radius , start , end , arc . counterclockwise , style , isClip ) ; } else { drawLine . call ( this , arc . x , arc . y ) ; } } } if ( ! moves [ i ] . arc ) { if ( moves [ i ] . close !== true && moves [ i ] . begin !== true ) { var x = moves [ i ] . start . x ; var y = moves [ i ] . start . y ; drawLines . call ( this , moves [ i ] . deltas , x , y , null , null ) ; } } } if ( style ) { putStyle . call ( this , style ) ; } if ( isClip ) { doClip . call ( this ) ; } }