+24
@@ -0,0 +1,24 @@
|
||||
import noop from "../noop.js";
|
||||
|
||||
export default function() {
|
||||
var lines = [],
|
||||
line;
|
||||
return {
|
||||
point: function(x, y, m) {
|
||||
line.push([x, y, m]);
|
||||
},
|
||||
lineStart: function() {
|
||||
lines.push(line = []);
|
||||
},
|
||||
lineEnd: noop,
|
||||
rejoin: function() {
|
||||
if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
|
||||
},
|
||||
result: function() {
|
||||
var result = lines;
|
||||
lines = [];
|
||||
line = null;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user