|
Last change
on this file was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
278 bytes
|
| Line | |
|---|
| 1 | export default class Polygon {
|
|---|
| 2 | constructor() {
|
|---|
| 3 | this._ = [];
|
|---|
| 4 | }
|
|---|
| 5 | moveTo(x, y) {
|
|---|
| 6 | this._.push([x, y]);
|
|---|
| 7 | }
|
|---|
| 8 | closePath() {
|
|---|
| 9 | this._.push(this._[0].slice());
|
|---|
| 10 | }
|
|---|
| 11 | lineTo(x, y) {
|
|---|
| 12 | this._.push([x, y]);
|
|---|
| 13 | }
|
|---|
| 14 | value() {
|
|---|
| 15 | return this._.length ? this._ : null;
|
|---|
| 16 | }
|
|---|
| 17 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.