+17
@@ -0,0 +1,17 @@
|
||||
export default class Polygon {
|
||||
constructor() {
|
||||
this._ = [];
|
||||
}
|
||||
moveTo(x, y) {
|
||||
this._.push([x, y]);
|
||||
}
|
||||
closePath() {
|
||||
this._.push(this._[0].slice());
|
||||
}
|
||||
lineTo(x, y) {
|
||||
this._.push([x, y]);
|
||||
}
|
||||
value() {
|
||||
return this._.length ? this._ : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user