瀏覽代碼

Double click support

tentone 6 年之前
父節點
當前提交
643fe50f44
共有 55 個文件被更改,包括 521 次插入110 次删除
  1. 60 11
      build/escher.js
  2. 0 0
      build/escher.min.js
  3. 60 11
      build/escher.module.js
  4. 1 1
      docs/BezierCurve.html
  5. 1 1
      docs/Box.html
  6. 1 1
      docs/Box2.html
  7. 1 1
      docs/BoxMask.html
  8. 1 1
      docs/Circle.html
  9. 1 1
      docs/DOM.html
  10. 1 1
      docs/EventManager.html
  11. 1 1
      docs/EventManager.js.html
  12. 1 1
      docs/Graph.html
  13. 1 1
      docs/Helpers.html
  14. 1 1
      docs/Image.html
  15. 1 1
      docs/Key.html
  16. 1 1
      docs/Line.html
  17. 1 1
      docs/Mask.html
  18. 269 23
      docs/Matrix.html
  19. 1 1
      docs/Object2D.html
  20. 1 1
      docs/Object2D.js.html
  21. 1 1
      docs/Pattern.html
  22. 1 1
      docs/Pointer.html
  23. 1 1
      docs/Renderer.html
  24. 1 1
      docs/Renderer.js.html
  25. 1 1
      docs/Text.html
  26. 1 1
      docs/UUID.html
  27. 1 1
      docs/Vector2.html
  28. 1 1
      docs/Viewport.html
  29. 1 1
      docs/Viewport.js.html
  30. 1 1
      docs/ViewportControls.html
  31. 1 1
      docs/controls_ViewportControls.js.html
  32. 1 1
      docs/index.html
  33. 1 1
      docs/input_Key.js.html
  34. 1 1
      docs/input_Pointer.js.html
  35. 1 1
      docs/math_Box2.js.html
  36. 18 8
      docs/math_Matrix.js.html
  37. 1 1
      docs/math_UUID.js.html
  38. 1 1
      docs/math_Vector2.js.html
  39. 1 1
      docs/objects_BezierCurve.js.html
  40. 1 1
      docs/objects_Box.js.html
  41. 1 1
      docs/objects_Circle.js.html
  42. 1 1
      docs/objects_DOM.js.html
  43. 1 1
      docs/objects_Graph.js.html
  44. 1 1
      docs/objects_Image.js.html
  45. 1 1
      docs/objects_Line.js.html
  46. 1 1
      docs/objects_Pattern.js.html
  47. 1 1
      docs/objects_Text.js.html
  48. 1 1
      docs/objects_mask_BoxMask.js.html
  49. 1 1
      docs/objects_mask_Mask.js.html
  50. 1 1
      docs/utils_Helpers.js.html
  51. 9 1
      examples/diagram.html
  52. 10 0
      source/Object2D.js
  53. 6 0
      source/Renderer.js
  54. 17 7
      source/math/Matrix.js
  55. 27 4
      source/objects/Text.js

+ 60 - 11
build/escher.js

@@ -531,6 +531,8 @@
 
 	/**
 	 * Copy the content of another matrix and store in this one.
+	 *
+	 * @param {Matrix} mat
 	 */
 	Matrix.prototype.copy = function(mat)
 	{
@@ -556,7 +558,7 @@
 	/**
 	 * Multiply another matrix by this one and store the result.
 	 *
-	 * @param mat Matrix array.
+	 * @param {Matrix} mat
 	 */
 	Matrix.prototype.multiply = function(mat)
 	{
@@ -573,7 +575,7 @@
 	/**
 	 * Premultiply another matrix by this one and store the result.
 	 *
-	 * @param mat Matrix array to multiply.
+	 * @param {Matrix} mat
 	 */
 	Matrix.prototype.premultiply = function(mat)
 	{
@@ -589,6 +591,14 @@
 
 	/**
 	 * Compose this transformation matrix with position scale and rotation and origin point.
+	 *
+	 * @param {number} px Position X
+	 * @param {number} py Position Y
+	 * @param {number} sx Scale X
+	 * @param {number} sy Scale Y
+	 * @param {number} ox Origin X (applied before scale and rotation)
+	 * @param {number} oy Origin Y (applied before scale and rotation)
+	 * @param {number} a Rotation angle (radians).
 	 */
 	Matrix.prototype.compose = function(px, py, sx, sy, ox, oy, a)
 	{
@@ -601,15 +611,15 @@
 			this.multiply(new Matrix([c, s, -s, c, 0, 0]));
 		}
 
-		if(ox !== 0 || oy !== 0)
-		{	
-			this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
-		}
-
 		if(sx !== 1 || sy !== 1)
 		{
 			this.scale(sx, sy);
 		}
+
+		if(ox !== 0 || oy !== 0)
+		{	
+			this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
+		}
 	};
 
 	/**
@@ -1140,6 +1150,16 @@
 	 */
 	Object2D.prototype.onButtonPressed = null;
 
+	/**
+	 * Callback method called while the pointer button is double clicked.
+	 *
+	 * Receives (pointer, viewport) as arguments.
+	 *
+	 * @param {Pointer} pointer Pointer object that receives the user input.
+	 * @param {Viewport} viewport Viewport where the object is drawn.
+	 */
+	Object2D.prototype.onDoubleClick = null;
+
 	/**
 	 * Callback method called when the pointer button is pressed down (single time).
 	 *
@@ -2013,6 +2033,12 @@
 						child.onPointerOver(pointer, viewport);
 					}
 
+					// Double click
+					if(pointer.buttonDoubleClicked(Pointer.LEFT) && child.onDoubleClick !== null)
+					{
+						child.onDoubleClick(pointer, viewport);
+					}
+
 					// Pointer pressed
 					if(pointer.buttonPressed(Pointer.LEFT) && child.onButtonPressed !== null)
 					{	
@@ -2835,9 +2861,23 @@
 		this.font = "16px Arial";
 
 		/**
-		 * Color (style) of the text.
+		 * Style of the object border line.
+		 *
+		 * If set null it is ignored.
+		 */
+		this.strokeStyle = null;
+
+		/**
+		 * Line width, only used if a valid strokeStyle is defined.
 		 */
-		this.color = "#000000";
+		this.lineWidth = 1;
+
+		/**
+		 * Background color of the box.
+		 *
+		 * If set null it is ignored.
+		 */
+		this.fillStyle = "#000000";
 
 		/**
 		 * Text align property.
@@ -2851,10 +2891,19 @@
 	{
 		context.font = this.font;
 		context.textAlign = this.textAlign;
-		context.fillStyle = this.color;
 		context.textBaseline = "middle";
 		
-		context.fillText(this.text, 0, 0);
+		if(this.fillStyle !== null)
+		{
+			context.fillStyle = this.fillStyle;
+			context.fillText(this.text, 0, 0);
+		}
+
+		if(this.strokeStyle !== null)
+		{
+			context.strokeStyle = this.strokeStyle;
+			context.strokeText(this.text, 0, 0);
+		}
 	};
 
 	/**

文件差異過大導致無法顯示
+ 0 - 0
build/escher.min.js


+ 60 - 11
build/escher.module.js

@@ -525,6 +525,8 @@ function Matrix(values)
 
 /**
  * Copy the content of another matrix and store in this one.
+ *
+ * @param {Matrix} mat
  */
 Matrix.prototype.copy = function(mat)
 {
@@ -550,7 +552,7 @@ Matrix.prototype.identity = function()
 /**
  * Multiply another matrix by this one and store the result.
  *
- * @param mat Matrix array.
+ * @param {Matrix} mat
  */
 Matrix.prototype.multiply = function(mat)
 {
@@ -567,7 +569,7 @@ Matrix.prototype.multiply = function(mat)
 /**
  * Premultiply another matrix by this one and store the result.
  *
- * @param mat Matrix array to multiply.
+ * @param {Matrix} mat
  */
 Matrix.prototype.premultiply = function(mat)
 {
@@ -583,6 +585,14 @@ Matrix.prototype.premultiply = function(mat)
 
 /**
  * Compose this transformation matrix with position scale and rotation and origin point.
+ *
+ * @param {number} px Position X
+ * @param {number} py Position Y
+ * @param {number} sx Scale X
+ * @param {number} sy Scale Y
+ * @param {number} ox Origin X (applied before scale and rotation)
+ * @param {number} oy Origin Y (applied before scale and rotation)
+ * @param {number} a Rotation angle (radians).
  */
 Matrix.prototype.compose = function(px, py, sx, sy, ox, oy, a)
 {
@@ -595,15 +605,15 @@ Matrix.prototype.compose = function(px, py, sx, sy, ox, oy, a)
 		this.multiply(new Matrix([c, s, -s, c, 0, 0]));
 	}
 
-	if(ox !== 0 || oy !== 0)
-	{	
-		this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
-	}
-
 	if(sx !== 1 || sy !== 1)
 	{
 		this.scale(sx, sy);
 	}
+
+	if(ox !== 0 || oy !== 0)
+	{	
+		this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
+	}
 };
 
 /**
@@ -1134,6 +1144,16 @@ Object2D.prototype.onPointerOver = null;
  */
 Object2D.prototype.onButtonPressed = null;
 
+/**
+ * Callback method called while the pointer button is double clicked.
+ *
+ * Receives (pointer, viewport) as arguments.
+ *
+ * @param {Pointer} pointer Pointer object that receives the user input.
+ * @param {Viewport} viewport Viewport where the object is drawn.
+ */
+Object2D.prototype.onDoubleClick = null;
+
 /**
  * Callback method called when the pointer button is pressed down (single time).
  *
@@ -2007,6 +2027,12 @@ Renderer.prototype.update = function(object, viewport)
 					child.onPointerOver(pointer, viewport);
 				}
 
+				// Double click
+				if(pointer.buttonDoubleClicked(Pointer.LEFT) && child.onDoubleClick !== null)
+				{
+					child.onDoubleClick(pointer, viewport);
+				}
+
 				// Pointer pressed
 				if(pointer.buttonPressed(Pointer.LEFT) && child.onButtonPressed !== null)
 				{	
@@ -2829,9 +2855,23 @@ function Text()
 	this.font = "16px Arial";
 
 	/**
-	 * Color (style) of the text.
+	 * Style of the object border line.
+	 *
+	 * If set null it is ignored.
+	 */
+	this.strokeStyle = null;
+
+	/**
+	 * Line width, only used if a valid strokeStyle is defined.
 	 */
-	this.color = "#000000";
+	this.lineWidth = 1;
+
+	/**
+	 * Background color of the box.
+	 *
+	 * If set null it is ignored.
+	 */
+	this.fillStyle = "#000000";
 
 	/**
 	 * Text align property.
@@ -2845,10 +2885,19 @@ Text.prototype.draw = function(context, viewport, canvas)
 {
 	context.font = this.font;
 	context.textAlign = this.textAlign;
-	context.fillStyle = this.color;
 	context.textBaseline = "middle";
 	
-	context.fillText(this.text, 0, 0);
+	if(this.fillStyle !== null)
+	{
+		context.fillStyle = this.fillStyle;
+		context.fillText(this.text, 0, 0);
+	}
+
+	if(this.strokeStyle !== null)
+	{
+		context.strokeStyle = this.strokeStyle;
+		context.strokeText(this.text, 0, 0);
+	}
 };
 
 /**

+ 1 - 1
docs/BezierCurve.html

@@ -691,7 +691,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Box.html

@@ -413,7 +413,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Box2.html

@@ -3010,7 +3010,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/BoxMask.html

@@ -492,7 +492,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Circle.html

@@ -413,7 +413,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/DOM.html

@@ -413,7 +413,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/EventManager.html

@@ -688,7 +688,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/EventManager.js.html

@@ -111,7 +111,7 @@ export {EventManager};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Graph.html

@@ -599,7 +599,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Helpers.html

@@ -341,7 +341,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Image.html

@@ -491,7 +491,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Key.html

@@ -619,7 +619,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Line.html

@@ -475,7 +475,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Mask.html

@@ -348,7 +348,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 269 - 23
docs/Matrix.html

@@ -262,7 +262,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line36">line 36</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line38">line 38</a>
     </li></ul></dd>
     
 
@@ -298,7 +298,7 @@
     
 
     
-    <h4 class="name" id="compose"><span class="type-signature"></span>compose<span class="signature">()</span><span class="type-signature"></span></h4>
+    <h4 class="name" id="compose"><span class="type-signature"></span>compose<span class="signature">(px, py, sx, sy, ox, oy, a)</span><span class="type-signature"></span></h4>
     
 
     
@@ -317,6 +317,193 @@
 
 
 
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>px</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Position X</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>py</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Position Y</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>sx</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Scale X</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>sy</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Scale Y</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>ox</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Origin X (applied before scale and rotation)</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>oy</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Origin Y (applied before scale and rotation)</td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>a</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last">Rotation angle (radians).</td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
 
 
 
@@ -350,7 +537,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line86">line 86</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line96">line 96</a>
     </li></ul></dd>
     
 
@@ -386,7 +573,7 @@
     
 
     
-    <h4 class="name" id="copy"><span class="type-signature"></span>copy<span class="signature">()</span><span class="type-signature"></span></h4>
+    <h4 class="name" id="copy"><span class="type-signature"></span>copy<span class="signature">(mat)</span><span class="type-signature"></span></h4>
     
 
     
@@ -405,6 +592,55 @@
 
 
 
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>mat</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="Matrix.html">Matrix</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
 
 
 
@@ -438,7 +674,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line28">line 28</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line30">line 30</a>
     </li></ul></dd>
     
 
@@ -526,7 +762,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line185">line 185</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line195">line 195</a>
     </li></ul></dd>
     
 
@@ -614,7 +850,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line193">line 193</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line203">line 203</a>
     </li></ul></dd>
     
 
@@ -702,7 +938,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line169">line 169</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line179">line 179</a>
     </li></ul></dd>
     
 
@@ -790,7 +1026,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line161">line 161</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line171">line 171</a>
     </li></ul></dd>
     
 
@@ -878,7 +1114,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line44">line 44</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line46">line 46</a>
     </li></ul></dd>
     
 
@@ -963,13 +1199,18 @@
 
             <td class="type">
             
+                
+<span class="param-type"><a href="Matrix.html">Matrix</a></span>
+
+
+            
             </td>
 
             
 
             
 
-            <td class="description last">Matrix array.</td>
+            <td class="description last"></td>
         </tr>
 
     
@@ -1010,7 +1251,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line54">line 54</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line56">line 56</a>
     </li></ul></dd>
     
 
@@ -1095,13 +1336,18 @@
 
             <td class="type">
             
+                
+<span class="param-type"><a href="Matrix.html">Matrix</a></span>
+
+
+            
             </td>
 
             
 
             
 
-            <td class="description last">Matrix array to multiply.</td>
+            <td class="description last"></td>
         </tr>
 
     
@@ -1142,7 +1388,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line71">line 71</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line73">line 73</a>
     </li></ul></dd>
     
 
@@ -1274,7 +1520,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line122">line 122</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line132">line 132</a>
     </li></ul></dd>
     
 
@@ -1362,7 +1608,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line141">line 141</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line151">line 151</a>
     </li></ul></dd>
     
 
@@ -1450,7 +1696,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line214">line 214</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line224">line 224</a>
     </li></ul></dd>
     
 
@@ -1538,7 +1784,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line152">line 152</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line162">line 162</a>
     </li></ul></dd>
     
 
@@ -1626,7 +1872,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line177">line 177</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line187">line 187</a>
     </li></ul></dd>
     
 
@@ -1714,7 +1960,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line222">line 222</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line232">line 232</a>
     </li></ul></dd>
     
 
@@ -1802,7 +2048,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line203">line 203</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line213">line 213</a>
     </li></ul></dd>
     
 
@@ -1890,7 +2136,7 @@
     
     <dt class="tag-source">Source:</dt>
     <dd class="tag-source"><ul class="dummy"><li>
-        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line111">line 111</a>
+        <a href="math_Matrix.js.html">math/Matrix.js</a>, <a href="math_Matrix.js.html#line121">line 121</a>
     </li></ul></dd>
     
 
@@ -1942,7 +2188,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Object2D.html

@@ -3434,7 +3434,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Object2D.js.html

@@ -434,7 +434,7 @@ export {Object2D};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Pattern.html

@@ -443,7 +443,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Pointer.html

@@ -2560,7 +2560,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Renderer.html

@@ -832,7 +832,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Renderer.js.html

@@ -334,7 +334,7 @@ export {Renderer};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Text.html

@@ -413,7 +413,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/UUID.html

@@ -227,7 +227,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Vector2.html

@@ -4679,7 +4679,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Viewport.html

@@ -1086,7 +1086,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/Viewport.js.html

@@ -160,7 +160,7 @@ export {Viewport};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/ViewportControls.html

@@ -789,7 +789,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/controls_ViewportControls.js.html

@@ -169,7 +169,7 @@ export {ViewportControls};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/index.html

@@ -56,7 +56,7 @@
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/input_Key.js.html

@@ -126,7 +126,7 @@ export {Key};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/input_Pointer.js.html

@@ -447,7 +447,7 @@ export {Pointer};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/math_Box2.js.html

@@ -316,7 +316,7 @@ export {Box2};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 18 - 8
docs/math_Matrix.js.html

@@ -52,6 +52,8 @@ function Matrix(values)
 
 /**
  * Copy the content of another matrix and store in this one.
+ *
+ * @param {Matrix} mat
  */
 Matrix.prototype.copy = function(mat)
 {
@@ -77,7 +79,7 @@ Matrix.prototype.identity = function()
 /**
  * Multiply another matrix by this one and store the result.
  *
- * @param mat Matrix array.
+ * @param {Matrix} mat
  */
 Matrix.prototype.multiply = function(mat)
 {
@@ -94,7 +96,7 @@ Matrix.prototype.multiply = function(mat)
 /**
  * Premultiply another matrix by this one and store the result.
  *
- * @param mat Matrix array to multiply.
+ * @param {Matrix} mat
  */
 Matrix.prototype.premultiply = function(mat)
 {
@@ -110,6 +112,14 @@ Matrix.prototype.premultiply = function(mat)
 
 /**
  * Compose this transformation matrix with position scale and rotation and origin point.
+ *
+ * @param {number} px Position X
+ * @param {number} py Position Y
+ * @param {number} sx Scale X
+ * @param {number} sy Scale Y
+ * @param {number} ox Origin X (applied before scale and rotation)
+ * @param {number} oy Origin Y (applied before scale and rotation)
+ * @param {number} a Rotation angle (radians).
  */
 Matrix.prototype.compose = function(px, py, sx, sy, ox, oy, a)
 {
@@ -122,15 +132,15 @@ Matrix.prototype.compose = function(px, py, sx, sy, ox, oy, a)
 		this.multiply(new Matrix([c, s, -s, c, 0, 0]));
 	}
 
-	if(ox !== 0 || oy !== 0)
-	{	
-		this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
-	}
-
 	if(sx !== 1 || sy !== 1)
 	{
 		this.scale(sx, sy);
 	}
+
+	if(ox !== 0 || oy !== 0)
+	{	
+		this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
+	}
 };
 
 /**
@@ -274,7 +284,7 @@ export {Matrix};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/math_UUID.js.html

@@ -83,7 +83,7 @@ export {UUID};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/math_Vector2.js.html

@@ -485,7 +485,7 @@ export {Vector2};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_BezierCurve.js.html

@@ -157,7 +157,7 @@ export {BezierCurve};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_Box.js.html

@@ -123,7 +123,7 @@ export {Box};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_Circle.js.html

@@ -119,7 +119,7 @@ export {Circle};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_DOM.js.html

@@ -114,7 +114,7 @@ export {DOM};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_Graph.js.html

@@ -143,7 +143,7 @@ export {Graph};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_Image.js.html

@@ -109,7 +109,7 @@ export {Image};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_Line.js.html

@@ -105,7 +105,7 @@ export {Line};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_Pattern.js.html

@@ -121,7 +121,7 @@ export {Pattern};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_Text.js.html

@@ -89,7 +89,7 @@ export {Text};
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_mask_BoxMask.js.html

@@ -100,7 +100,7 @@ export {BoxMask};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/objects_mask_Mask.js.html

@@ -77,7 +77,7 @@ export {Mask};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 1 - 1
docs/utils_Helpers.js.html

@@ -155,7 +155,7 @@ export {Helpers};</code></pre>
 <br class="clear">
 
 <footer>
-    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:15:30 GMT+0100 (Western European Summer Time)
+    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Mon Jun 17 2019 11:18:24 GMT+0100 (Western European Summer Time)
 </footer>
 
 <script> prettyPrint(); </script>

+ 9 - 1
examples/diagram.html

@@ -192,7 +192,7 @@
 		circle.radius = 60;
 		circle.position.set(300, 0);
 		circle.draggable = true;
-		circle.onButtonDown = function()
+		circle.onDoubleClick = function()
 		{
 			viewport.centerObject(circle, canvas);
 		}
@@ -202,6 +202,14 @@
 		text.text = "Canvas Text";
 		circle.add(text);
 
+		var text = new Escher.Text();
+		text.text = "Double-click to center!";
+		text.font = "30px Comic Sans MS";
+		text.position.set(0, -75);
+		text.strokeStyle = "#000000";
+		text.fillStyle = "#FFFFFF";
+		circle.add(text);
+
 		// Line (connection)
 		var line = new Escher.Line();
 		line.from = boxA.position;

+ 10 - 0
source/Object2D.js

@@ -369,6 +369,16 @@ Object2D.prototype.onPointerOver = null;
  */
 Object2D.prototype.onButtonPressed = null;
 
+/**
+ * Callback method called while the pointer button is double clicked.
+ *
+ * Receives (pointer, viewport) as arguments.
+ *
+ * @param {Pointer} pointer Pointer object that receives the user input.
+ * @param {Viewport} viewport Viewport where the object is drawn.
+ */
+Object2D.prototype.onDoubleClick = null;
+
 /**
  * Callback method called when the pointer button is pressed down (single time).
  *

+ 6 - 0
source/Renderer.js

@@ -146,6 +146,12 @@ Renderer.prototype.update = function(object, viewport)
 					child.onPointerOver(pointer, viewport);
 				}
 
+				// Double click
+				if(pointer.buttonDoubleClicked(Pointer.LEFT) && child.onDoubleClick !== null)
+				{
+					child.onDoubleClick(pointer, viewport);
+				}
+
 				// Pointer pressed
 				if(pointer.buttonPressed(Pointer.LEFT) && child.onButtonPressed !== null)
 				{	

+ 17 - 7
source/math/Matrix.js

@@ -24,6 +24,8 @@ function Matrix(values)
 
 /**
  * Copy the content of another matrix and store in this one.
+ *
+ * @param {Matrix} mat
  */
 Matrix.prototype.copy = function(mat)
 {
@@ -49,7 +51,7 @@ Matrix.prototype.identity = function()
 /**
  * Multiply another matrix by this one and store the result.
  *
- * @param mat Matrix array.
+ * @param {Matrix} mat
  */
 Matrix.prototype.multiply = function(mat)
 {
@@ -66,7 +68,7 @@ Matrix.prototype.multiply = function(mat)
 /**
  * Premultiply another matrix by this one and store the result.
  *
- * @param mat Matrix array to multiply.
+ * @param {Matrix} mat
  */
 Matrix.prototype.premultiply = function(mat)
 {
@@ -82,6 +84,14 @@ Matrix.prototype.premultiply = function(mat)
 
 /**
  * Compose this transformation matrix with position scale and rotation and origin point.
+ *
+ * @param {number} px Position X
+ * @param {number} py Position Y
+ * @param {number} sx Scale X
+ * @param {number} sy Scale Y
+ * @param {number} ox Origin X (applied before scale and rotation)
+ * @param {number} oy Origin Y (applied before scale and rotation)
+ * @param {number} a Rotation angle (radians).
  */
 Matrix.prototype.compose = function(px, py, sx, sy, ox, oy, a)
 {
@@ -94,15 +104,15 @@ Matrix.prototype.compose = function(px, py, sx, sy, ox, oy, a)
 		this.multiply(new Matrix([c, s, -s, c, 0, 0]));
 	}
 
-	if(ox !== 0 || oy !== 0)
-	{	
-		this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
-	}
-
 	if(sx !== 1 || sy !== 1)
 	{
 		this.scale(sx, sy);
 	}
+
+	if(ox !== 0 || oy !== 0)
+	{	
+		this.multiply(new Matrix([1, 0, 0, 1, -ox, -oy]));
+	}
 };
 
 /**

+ 27 - 4
source/objects/Text.js

@@ -22,9 +22,23 @@ function Text()
 	this.font = "16px Arial";
 
 	/**
-	 * Color (style) of the text.
+	 * Style of the object border line.
+	 *
+	 * If set null it is ignored.
 	 */
-	this.color = "#000000";
+	this.strokeStyle = null;
+
+	/**
+	 * Line width, only used if a valid strokeStyle is defined.
+	 */
+	this.lineWidth = 1;
+
+	/**
+	 * Background color of the box.
+	 *
+	 * If set null it is ignored.
+	 */
+	this.fillStyle = "#000000";
 
 	/**
 	 * Text align property.
@@ -38,10 +52,19 @@ Text.prototype.draw = function(context, viewport, canvas)
 {
 	context.font = this.font;
 	context.textAlign = this.textAlign;
-	context.fillStyle = this.color;
 	context.textBaseline = "middle";
 	
-	context.fillText(this.text, 0, 0);
+	if(this.fillStyle !== null)
+	{
+		context.fillStyle = this.fillStyle;
+		context.fillText(this.text, 0, 0);
+	}
+
+	if(this.strokeStyle !== null)
+	{
+		context.strokeStyle = this.strokeStyle;
+		context.strokeText(this.text, 0, 0);
+	}
 };
 
 export {Text};

部分文件因文件數量過多而無法顯示