|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
517 bytes
|
| Line | |
|---|
| 1 | import noop from "../noop.js";
|
|---|
| 2 |
|
|---|
| 3 | function LinearClosed(context) {
|
|---|
| 4 | this._context = context;
|
|---|
| 5 | }
|
|---|
| 6 |
|
|---|
| 7 | LinearClosed.prototype = {
|
|---|
| 8 | areaStart: noop,
|
|---|
| 9 | areaEnd: noop,
|
|---|
| 10 | lineStart: function() {
|
|---|
| 11 | this._point = 0;
|
|---|
| 12 | },
|
|---|
| 13 | lineEnd: function() {
|
|---|
| 14 | if (this._point) this._context.closePath();
|
|---|
| 15 | },
|
|---|
| 16 | point: function(x, y) {
|
|---|
| 17 | x = +x, y = +y;
|
|---|
| 18 | if (this._point) this._context.lineTo(x, y);
|
|---|
| 19 | else this._point = 1, this._context.moveTo(x, y);
|
|---|
| 20 | }
|
|---|
| 21 | };
|
|---|
| 22 |
|
|---|
| 23 | export default function(context) {
|
|---|
| 24 | return new LinearClosed(context);
|
|---|
| 25 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.