tentone 5 年之前
父節點
當前提交
a26cc01486
共有 4 個文件被更改,包括 21 次插入3 次删除
  1. 20 1
      README.md
  2. 0 1
      examples/stress.html
  3. 二進制
      readme/hello.png
  4. 1 1
      source/input/Pointer.js

+ 20 - 1
README.md

@@ -82,6 +82,24 @@ renderer.createRenderLoop(group, viewport);
 
 ![graph](<https://tentone.github.io/escher.js/readme/hello.png>)
 
+- If the application is not running a full screen canvas there might be some problems with the page scrolling around or showing context menu while interacting to prevent this we can disable/prevent these browser events.
+  - In the example we use the `EventManager` object to create and manage these events but we could also create these directly attached to the DOM elements.
+
+```javascript
+function preventDefault(event)
+{
+    event.preventDefault();
+    return false;
+}
+
+var event = new EventManager();
+event.add(canvas, 'DOMMouseScroll', preventDefault);
+event.add(canvas, 'wheel', preventDefault);
+event.add(canvas, 'mousewheel', preventDefault);
+event.add(canvas, 'contextmenu', preventDefault);
+event.create();
+```
+
 
 
 ### Viewport
@@ -89,7 +107,8 @@ renderer.createRenderLoop(group, viewport);
 - The `Viewport` is the object that indicates how the user will view the objects, the viewport can be used to change the position of the elements, zoom in and out, or even rotate the entire canvas.
 - Some object might ignore the viewport transformations by setting the `ignoreViewport` flag to false. This will indicate to the renderer to reset the viewport transform for that object so that the viewport does not affect it.
 - We can use the `ViewportController` (or implement new variants of this object) to allow the user control over the viewport.
-- 
+
+![graph](<https://tentone.github.io/escher.js/readme/viewport.png>)
 
 
 

+ 0 - 1
examples/stress.html

@@ -28,7 +28,6 @@
 		perfDelta.style.fontSize = "20px";
 		document.body.appendChild(perfDelta);
 
-
 		// Setup the display canvas
 		var canvas = document.createElement("canvas");
 		canvas.style.position = "absolute";

二進制
readme/hello.png


+ 1 - 1
source/input/Pointer.js

@@ -212,7 +212,7 @@ Pointer.FORWARD = 4;
 /**
  * Element to be used for coordinates calculation relative to that canvas.
  * 
- * @param {DOM} canvas Canvas to be attached to the Pointer instance
+ * @param {DOM} element Canvas to be attached to the Pointer instance
  */
 Pointer.setCanvas = function(element)
 {