mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
15 lines
No EOL
684 B
JavaScript
15 lines
No EOL
684 B
JavaScript
module('Path Drawing Commands');
|
|
|
|
test('path.lineTo(point);', function() {
|
|
var path = new Path();
|
|
path.moveTo([50, 50]);
|
|
path.lineTo([100, 100]);
|
|
equals(path.segments.toString(), '{ point: { x: 50, y: 50 } },{ point: { x: 100, y: 100 } }');
|
|
});
|
|
|
|
test('path.arcTo(from, through, to);', function() {
|
|
var path = new Path();
|
|
path.moveTo([50, 50]);
|
|
path.arcTo([100, 100], [75, 75]);
|
|
equals(path.segments.toString(), '{ point: { x: 50, y: 50 }, handleOut: { x: 10.11156, y: -10.11156 } },{ point: { x: 88.5299, y: 42.33593 }, handleIn: { x: -13.21138, y: -5.47233 }, handleOut: { x: 13.21138, y: 5.47233 } },{ point: { x: 110.35534, y: 75 }, handleIn: { x: 0, y: -14.2999 } }');
|
|
}); |