pts 0.10.7 → 0.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { MultiTouchSpace } from './Space';
3
3
  import { VisualForm, Font } from "./Form";
4
4
  import { Pt, Group, Bound } from "./Pt";
@@ -107,13 +107,13 @@ export class CanvasSpace extends MultiTouchSpace {
107
107
  get autoResize() { return this._autoResize; }
108
108
  resize(b, evt) {
109
109
  this.bound = b;
110
- this._canvas.width = this.bound.size.x * this._pixelScale;
111
- this._canvas.height = this.bound.size.y * this._pixelScale;
112
- this._canvas.style.width = Math.floor(this.bound.size.x) + "px";
113
- this._canvas.style.height = Math.floor(this.bound.size.y) + "px";
110
+ this._canvas.width = Math.ceil(this.bound.size.x) * this._pixelScale;
111
+ this._canvas.height = Math.ceil(this.bound.size.y) * this._pixelScale;
112
+ this._canvas.style.width = Math.ceil(this.bound.size.x) + "px";
113
+ this._canvas.style.height = Math.ceil(this.bound.size.y) + "px";
114
114
  if (this._offscreen) {
115
- this._offCanvas.width = this.bound.size.x * this._pixelScale;
116
- this._offCanvas.height = this.bound.size.y * this._pixelScale;
115
+ this._offCanvas.width = Math.ceil(this.bound.size.x) * this._pixelScale;
116
+ this._offCanvas.height = Math.ceil(this.bound.size.y) * this._pixelScale;
117
117
  }
118
118
  if (this._pixelScale != 1) {
119
119
  this._ctx.scale(this._pixelScale, this._pixelScale);
@@ -168,27 +168,29 @@ export class CanvasSpace extends MultiTouchSpace {
168
168
  if (bg)
169
169
  this._bgcolor = bg;
170
170
  const lastColor = this._ctx.fillStyle;
171
+ const px = Math.ceil(this.pixelScale);
171
172
  if (!this._bgcolor || this._bgcolor === "transparent") {
172
- this._ctx.clearRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
173
+ this._ctx.clearRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
173
174
  }
174
175
  else {
175
176
  if (this._bgcolor.indexOf("rgba") === 0 || (this._bgcolor.length === 9 && this._bgcolor.indexOf("#") === 0)) {
176
- this._ctx.clearRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
177
+ this._ctx.clearRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
177
178
  }
178
179
  this._ctx.fillStyle = this._bgcolor;
179
- this._ctx.fillRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
180
+ this._ctx.fillRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
180
181
  }
181
182
  this._ctx.fillStyle = lastColor;
182
183
  return this;
183
184
  }
184
185
  clearOffscreen(bg) {
185
186
  if (this._offscreen) {
187
+ const px = Math.ceil(this.pixelScale);
186
188
  if (bg) {
187
189
  this._offCtx.fillStyle = bg;
188
- this._offCtx.fillRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
190
+ this._offCtx.fillRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
189
191
  }
190
192
  else {
191
- this._offCtx.clearRect(-1, -1, this._offCanvas.width + 1, this._offCanvas.height + 1);
193
+ this._offCtx.clearRect(-px, -px, this._offCanvas.width + px, this._offCanvas.height + px);
192
194
  }
193
195
  }
194
196
  return this;
@@ -312,6 +314,19 @@ export class CanvasForm extends VisualForm {
312
314
  }
313
315
  return this;
314
316
  }
317
+ applyFillStroke(filled = true, stroked = true, strokeWidth = 1) {
318
+ if (filled) {
319
+ if (typeof filled === 'string')
320
+ this.fill(filled);
321
+ this._ctx.fill();
322
+ }
323
+ if (stroked) {
324
+ if (typeof stroked === 'string')
325
+ this.stroke(stroked, strokeWidth);
326
+ this._ctx.stroke();
327
+ }
328
+ return this;
329
+ }
315
330
  gradient(stops) {
316
331
  let vals = [];
317
332
  if (stops.length < 2)
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Pt, Group } from "./Pt";
3
3
  import { Util } from "./Util";
4
4
  import { Num, Geom } from "./Num";
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Pt, Group } from "./Pt";
3
3
  import { Line, Triangle } from "./Op";
4
4
  import { Const, Util } from "./Util";
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { MultiTouchSpace } from './Space';
3
3
  import { VisualForm, Font } from "./Form";
4
4
  import { Util } from './Util';
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  export class Form {
3
3
  constructor() {
4
4
  this._ready = false;
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Pt, Group } from "./Pt";
3
3
  import { Line } from "./Op";
4
4
  export class Vec {
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Const, Util } from "./Util";
3
3
  import { Curve } from "./Op";
4
4
  import { Pt, Group } from "./Pt";
package/dist/es2015/Op.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Util } from "./Util";
3
3
  import { Geom, Num } from "./Num";
4
4
  import { Pt, Group } from "./Pt";
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Pt, Group, Bound } from "./Pt";
3
3
  import { Polygon, Circle } from "./Op";
4
4
  import { Geom } from "./Num";
package/dist/es2015/Pt.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Util, Const } from "./Util";
3
3
  import { Geom, Num } from "./Num";
4
4
  import { Vec, Mat } from "./LinearAlgebra";
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Pt, Bound } from "./Pt";
3
3
  import { UIPointerActions as UIA } from "./UI";
4
4
  export class Space {
@@ -91,7 +91,7 @@ export class Space {
91
91
  this._time.end = t;
92
92
  return this;
93
93
  }
94
- playOnce(duration = 5000) {
94
+ playOnce(duration = 0) {
95
95
  this.play();
96
96
  this.stop(duration);
97
97
  return this;
@@ -132,23 +132,29 @@ export class MultiTouchSpace extends Space {
132
132
  }
133
133
  bindMouse(_bind = true) {
134
134
  if (_bind) {
135
- this.bindCanvas("mousedown", this._mouseDown.bind(this));
136
- this.bindCanvas("mouseup", this._mouseUp.bind(this));
137
- this.bindCanvas("mouseover", this._mouseOver.bind(this));
138
- this.bindCanvas("mouseout", this._mouseOut.bind(this));
139
- this.bindCanvas("mousemove", this._mouseMove.bind(this));
140
- this.bindCanvas("click", this._mouseClick.bind(this));
141
- this.bindCanvas("contextmenu", this._contextMenu.bind(this));
135
+ this._mouseDown = this._mouseDown.bind(this);
136
+ this._mouseUp = this._mouseUp.bind(this);
137
+ this._mouseOver = this._mouseOver.bind(this);
138
+ this._mouseMove = this._mouseMove.bind(this);
139
+ this._mouseClick = this._mouseClick.bind(this);
140
+ this._contextMenu = this._contextMenu.bind(this);
141
+ this.bindCanvas("mousedown", this._mouseDown);
142
+ this.bindCanvas("mouseup", this._mouseUp);
143
+ this.bindCanvas("mouseover", this._mouseOver);
144
+ this.bindCanvas("mouseout", this._mouseOut);
145
+ this.bindCanvas("mousemove", this._mouseMove);
146
+ this.bindCanvas("click", this._mouseClick);
147
+ this.bindCanvas("contextmenu", this._contextMenu);
142
148
  this._hasMouse = true;
143
149
  }
144
150
  else {
145
- this.unbindCanvas("mousedown", this._mouseDown.bind(this));
146
- this.unbindCanvas("mouseup", this._mouseUp.bind(this));
147
- this.unbindCanvas("mouseover", this._mouseOver.bind(this));
148
- this.unbindCanvas("mouseout", this._mouseOut.bind(this));
149
- this.unbindCanvas("mousemove", this._mouseMove.bind(this));
150
- this.unbindCanvas("click", this._mouseClick.bind(this));
151
- this.unbindCanvas("contextmenu", this._contextMenu.bind(this));
151
+ this.unbindCanvas("mousedown", this._mouseDown);
152
+ this.unbindCanvas("mouseup", this._mouseUp);
153
+ this.unbindCanvas("mouseover", this._mouseOver);
154
+ this.unbindCanvas("mouseout", this._mouseOut);
155
+ this.unbindCanvas("mousemove", this._mouseMove);
156
+ this.unbindCanvas("click", this._mouseClick);
157
+ this.unbindCanvas("contextmenu", this._contextMenu);
152
158
  this._hasMouse = false;
153
159
  }
154
160
  return this;
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { VisualForm, Font } from "./Form";
3
3
  import { Geom } from './Num';
4
4
  import { Const, Util } from './Util';
@@ -1,3 +1,3 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  export {};
3
3
  //# sourceMappingURL=Types.js.map
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Pt, Bound } from "./Pt";
3
3
  export class Typography {
4
4
  static textWidthEstimator(fn, samples = ["M", "n", "."], distribution = [0.06, 0.8, 0.14]) {
package/dist/es2015/UI.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Pt, Group } from "./Pt";
3
3
  import { Rectangle, Circle, Polygon } from "./Op";
4
4
  export const UIShape = {
@@ -1,4 +1,4 @@
1
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2
2
  import { Num } from "./Num";
3
3
  import { Group } from "./Pt";
4
4
  export const Const = {
package/dist/es5.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * pts.js 0.10.7 - Copyright © 2017-2021 William Ngan and contributors.
2
+ * pts.js 0.10.8 - Copyright © 2017-2021 William Ngan and contributors.
3
3
  * Licensed under Apache 2.0 License.
4
4
  * See https://github.com/williamngan/pts for details.
5
5
  */
@@ -110,7 +110,7 @@ return /******/ (function(modules) { // webpackBootstrap
110
110
 
111
111
  "use strict";
112
112
 
113
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
113
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
114
114
 
115
115
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
116
116
 
@@ -234,13 +234,13 @@ var CanvasSpace = function (_Space_1$MultiTouchSp) {
234
234
  key: "resize",
235
235
  value: function resize(b, evt) {
236
236
  this.bound = b;
237
- this._canvas.width = this.bound.size.x * this._pixelScale;
238
- this._canvas.height = this.bound.size.y * this._pixelScale;
239
- this._canvas.style.width = Math.floor(this.bound.size.x) + "px";
240
- this._canvas.style.height = Math.floor(this.bound.size.y) + "px";
237
+ this._canvas.width = Math.ceil(this.bound.size.x) * this._pixelScale;
238
+ this._canvas.height = Math.ceil(this.bound.size.y) * this._pixelScale;
239
+ this._canvas.style.width = Math.ceil(this.bound.size.x) + "px";
240
+ this._canvas.style.height = Math.ceil(this.bound.size.y) + "px";
241
241
  if (this._offscreen) {
242
- this._offCanvas.width = this.bound.size.x * this._pixelScale;
243
- this._offCanvas.height = this.bound.size.y * this._pixelScale;
242
+ this._offCanvas.width = Math.ceil(this.bound.size.x) * this._pixelScale;
243
+ this._offCanvas.height = Math.ceil(this.bound.size.y) * this._pixelScale;
244
244
  }
245
245
  if (this._pixelScale != 1) {
246
246
  this._ctx.scale(this._pixelScale, this._pixelScale);
@@ -279,14 +279,15 @@ var CanvasSpace = function (_Space_1$MultiTouchSp) {
279
279
  value: function clear(bg) {
280
280
  if (bg) this._bgcolor = bg;
281
281
  var lastColor = this._ctx.fillStyle;
282
+ var px = Math.ceil(this.pixelScale);
282
283
  if (!this._bgcolor || this._bgcolor === "transparent") {
283
- this._ctx.clearRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
284
+ this._ctx.clearRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
284
285
  } else {
285
286
  if (this._bgcolor.indexOf("rgba") === 0 || this._bgcolor.length === 9 && this._bgcolor.indexOf("#") === 0) {
286
- this._ctx.clearRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
287
+ this._ctx.clearRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
287
288
  }
288
289
  this._ctx.fillStyle = this._bgcolor;
289
- this._ctx.fillRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
290
+ this._ctx.fillRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
290
291
  }
291
292
  this._ctx.fillStyle = lastColor;
292
293
  return this;
@@ -295,11 +296,12 @@ var CanvasSpace = function (_Space_1$MultiTouchSp) {
295
296
  key: "clearOffscreen",
296
297
  value: function clearOffscreen(bg) {
297
298
  if (this._offscreen) {
299
+ var px = Math.ceil(this.pixelScale);
298
300
  if (bg) {
299
301
  this._offCtx.fillStyle = bg;
300
- this._offCtx.fillRect(-1, -1, this._canvas.width + 1, this._canvas.height + 1);
302
+ this._offCtx.fillRect(-px, -px, this._canvas.width + px, this._canvas.height + px);
301
303
  } else {
302
- this._offCtx.clearRect(-1, -1, this._offCanvas.width + 1, this._offCanvas.height + 1);
304
+ this._offCtx.clearRect(-px, -px, this._offCanvas.width + px, this._offCanvas.height + px);
303
305
  }
304
306
  }
305
307
  return this;
@@ -513,6 +515,23 @@ var CanvasForm = function (_Form_1$VisualForm) {
513
515
  }
514
516
  return this;
515
517
  }
518
+ }, {
519
+ key: "applyFillStroke",
520
+ value: function applyFillStroke() {
521
+ var filled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
522
+ var stroked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
523
+ var strokeWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
524
+
525
+ if (filled) {
526
+ if (typeof filled === 'string') this.fill(filled);
527
+ this._ctx.fill();
528
+ }
529
+ if (stroked) {
530
+ if (typeof stroked === 'string') this.stroke(stroked, strokeWidth);
531
+ this._ctx.stroke();
532
+ }
533
+ return this;
534
+ }
516
535
  }, {
517
536
  key: "gradient",
518
537
  value: function gradient(stops) {
@@ -999,7 +1018,7 @@ exports.CanvasForm = CanvasForm;
999
1018
 
1000
1019
  "use strict";
1001
1020
 
1002
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1021
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1003
1022
 
1004
1023
  var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
1005
1024
 
@@ -1620,7 +1639,7 @@ Color.ranges = {
1620
1639
 
1621
1640
  "use strict";
1622
1641
 
1623
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1642
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
1624
1643
 
1625
1644
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1626
1645
 
@@ -2028,7 +2047,7 @@ exports.Delaunay = Delaunay;
2028
2047
 
2029
2048
  "use strict";
2030
2049
 
2031
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2050
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2032
2051
 
2033
2052
  var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
2034
2053
 
@@ -2637,7 +2656,7 @@ HTMLForm.domID = 0;
2637
2656
 
2638
2657
  "use strict";
2639
2658
 
2640
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2659
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
2641
2660
 
2642
2661
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2643
2662
 
@@ -3074,7 +3093,7 @@ exports.Img = Img;
3074
3093
 
3075
3094
  "use strict";
3076
3095
 
3077
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
3096
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
3078
3097
 
3079
3098
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3080
3099
 
@@ -3421,7 +3440,7 @@ exports.Mat = Mat;
3421
3440
 
3422
3441
  "use strict";
3423
3442
 
3424
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
3443
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
3425
3444
 
3426
3445
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3427
3446
 
@@ -4211,7 +4230,7 @@ exports.Range = Range;
4211
4230
 
4212
4231
  "use strict";
4213
4232
 
4214
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
4233
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
4215
4234
 
4216
4235
  var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
4217
4236
 
@@ -5574,7 +5593,7 @@ exports.Curve = Curve;
5574
5593
 
5575
5594
  "use strict";
5576
5595
 
5577
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
5596
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
5578
5597
 
5579
5598
  var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
5580
5599
 
@@ -6746,7 +6765,7 @@ exports.Sound = Sound;
6746
6765
 
6747
6766
  "use strict";
6748
6767
 
6749
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
6768
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
6750
6769
 
6751
6770
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
6752
6771
 
@@ -7799,7 +7818,7 @@ exports.Bound = Bound;
7799
7818
 
7800
7819
  "use strict";
7801
7820
 
7802
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
7821
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
7803
7822
 
7804
7823
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
7805
7824
 
@@ -7930,7 +7949,7 @@ var Space = function () {
7930
7949
  }, {
7931
7950
  key: "playOnce",
7932
7951
  value: function playOnce() {
7933
- var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000;
7952
+ var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
7934
7953
 
7935
7954
  this.play();
7936
7955
  this.stop(duration);
@@ -8027,22 +8046,28 @@ var MultiTouchSpace = function (_Space) {
8027
8046
  var _bind = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
8028
8047
 
8029
8048
  if (_bind) {
8030
- this.bindCanvas("mousedown", this._mouseDown.bind(this));
8031
- this.bindCanvas("mouseup", this._mouseUp.bind(this));
8032
- this.bindCanvas("mouseover", this._mouseOver.bind(this));
8033
- this.bindCanvas("mouseout", this._mouseOut.bind(this));
8034
- this.bindCanvas("mousemove", this._mouseMove.bind(this));
8035
- this.bindCanvas("click", this._mouseClick.bind(this));
8036
- this.bindCanvas("contextmenu", this._contextMenu.bind(this));
8049
+ this._mouseDown = this._mouseDown.bind(this);
8050
+ this._mouseUp = this._mouseUp.bind(this);
8051
+ this._mouseOver = this._mouseOver.bind(this);
8052
+ this._mouseMove = this._mouseMove.bind(this);
8053
+ this._mouseClick = this._mouseClick.bind(this);
8054
+ this._contextMenu = this._contextMenu.bind(this);
8055
+ this.bindCanvas("mousedown", this._mouseDown);
8056
+ this.bindCanvas("mouseup", this._mouseUp);
8057
+ this.bindCanvas("mouseover", this._mouseOver);
8058
+ this.bindCanvas("mouseout", this._mouseOut);
8059
+ this.bindCanvas("mousemove", this._mouseMove);
8060
+ this.bindCanvas("click", this._mouseClick);
8061
+ this.bindCanvas("contextmenu", this._contextMenu);
8037
8062
  this._hasMouse = true;
8038
8063
  } else {
8039
- this.unbindCanvas("mousedown", this._mouseDown.bind(this));
8040
- this.unbindCanvas("mouseup", this._mouseUp.bind(this));
8041
- this.unbindCanvas("mouseover", this._mouseOver.bind(this));
8042
- this.unbindCanvas("mouseout", this._mouseOut.bind(this));
8043
- this.unbindCanvas("mousemove", this._mouseMove.bind(this));
8044
- this.unbindCanvas("click", this._mouseClick.bind(this));
8045
- this.unbindCanvas("contextmenu", this._contextMenu.bind(this));
8064
+ this.unbindCanvas("mousedown", this._mouseDown);
8065
+ this.unbindCanvas("mouseup", this._mouseUp);
8066
+ this.unbindCanvas("mouseover", this._mouseOver);
8067
+ this.unbindCanvas("mouseout", this._mouseOut);
8068
+ this.unbindCanvas("mousemove", this._mouseMove);
8069
+ this.unbindCanvas("click", this._mouseClick);
8070
+ this.unbindCanvas("contextmenu", this._contextMenu);
8046
8071
  this._hasMouse = false;
8047
8072
  }
8048
8073
  return this;
@@ -8208,7 +8233,7 @@ exports.MultiTouchSpace = MultiTouchSpace;
8208
8233
 
8209
8234
  "use strict";
8210
8235
 
8211
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
8236
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
8212
8237
 
8213
8238
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8214
8239
 
@@ -8716,7 +8741,7 @@ SVGForm.domID = 0;
8716
8741
 
8717
8742
  "use strict";
8718
8743
 
8719
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
8744
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
8720
8745
 
8721
8746
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8722
8747
 
@@ -8801,7 +8826,7 @@ exports.Typography = Typography;
8801
8826
 
8802
8827
  "use strict";
8803
8828
 
8804
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
8829
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
8805
8830
 
8806
8831
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8807
8832
 
@@ -9189,7 +9214,7 @@ exports.UIDragger = UIDragger;
9189
9214
 
9190
9215
  "use strict";
9191
9216
 
9192
- /*! Source code licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
9217
+ /*! Pts.js is licensed under Apache License 2.0. Copyright © 2017-current William Ngan and contributors. (https://github.com/williamngan/pts) */
9193
9218
 
9194
9219
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
9195
9220