@@ -375,15 +375,30 @@ class Path
375
375
376
376
-- Gets the normalized tangent on the Path given a time
377
377
getNormalized : ( t = 0.5 ) =>
378
- sumLength, length, tan, p, u = 0 , t * @getLength !, nil , nil , nil
379
- @callBackPath ( id, seg) ->
380
- segmentLen = seg\ getLength!
378
+ sumLength, length, newPath, tan, p, u = 0 , t * @getLength !, Path !, nil , nil , nil
379
+ @callBackPath ( id, seg, k) ->
380
+ path, segmentLen = {} , seg\ getLength!
381
+ if newPath. path[ k] == nil
382
+ newPath. path[ k] = { seg. a}
381
383
if sumLength + segmentLen >= length
382
384
u = ( length - sumLength) / segmentLen
383
385
tan, p, u = seg\ getNormalized u
384
- return " break"
386
+ spt = seg\ split( u) [ 1 ]
387
+ if id == ' l'
388
+ insert newPath. path[ k] , spt. b
389
+ else if id == ' b'
390
+ insert newPath. path[ k] , spt. b
391
+ insert newPath. path[ k] , spt. c
392
+ insert newPath. path[ k] , spt. b
393
+ return " break" , p, u, newPath
394
+ if id == ' l'
395
+ insert newPath. path[ k] , seg. b
396
+ else
397
+ insert newPath. path[ k] , seg. b
398
+ insert newPath. path[ k] , seg. c
399
+ insert newPath. path[ k] , seg. d
385
400
sumLength += segmentLen
386
- return tan, p, u
401
+ return tan, p, u, newPath
387
402
388
403
-- Distort the Path into another Path
389
404
-- http://www.planetclegg.com/projects/WarpingTextToSplines.html
0 commit comments