Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'multitouch'

  • Loading branch information...
commit 9fc6b2f8bbf987eb42f29c18f88c96879a5ab529 2 parents 3ba1c2c + 771b85e
@mythmon mythmon authored
Showing with 11 additions and 10 deletions.
  1. +8 −8 web/index.html
  2. +3 −2 web/js/board.js
View
16 web/index.html
@@ -25,24 +25,24 @@
</div>
<canvas id="board" width="800" height="600"></canvas>
<div id="sidepanel">
- <h3>Selected</h3>
- <div>
- <ul id="selectedinfo">
- </ul>
- </div>
- <hr>
<h3>Options</h3>
<div id="options">
<input type="checkbox" id="snap" />Snap
</div>
- <hr>
+ <hr/>
<h3>Actions</h3>
<div id="actions">
</div>
- <hr>
+ <hr/>
<h3>Reductions</h3>
<div id="reductions">
</div>
+ <hr/>
+ <h3>Selected</h3>
+ <div>
+ <ul id="selectedinfo">
+ </ul>
+ </div>
</div>
<br />
Serialization:<br />
View
5 web/js/board.js
@@ -43,6 +43,7 @@ var Board = Class.extend({
self.snap = true;
self.snap_size = 20;
+ self.fuzzy_hit = 15;
setInterval($.proxy(self.redraw, self), 33);
@@ -603,7 +604,7 @@ var Node = ScreenObject.extend({
/* Check if a given point is within the bounds of self node. */
hit_test: function(self, x, y) {
// Make clicking a bit easier.
- var fuzzy_r = self.r + 5;
+ var fuzzy_r = self.r + self.board.fuzzy_hit;
// Fast bounding box check
if ((Math.abs(x - self.x) > fuzzy_r) || (Math.abs(y - self.y) > fuzzy_r)) {
@@ -821,7 +822,7 @@ var ProtoWire = ScreenObject.extend({
},
hit_test: function(self, x, y) {
- var fuzzy_r = 7;
+ var fuzzy_r = self.board.fuzzy_hit;
// Find bounding box.
var left = self.n1.x;
var right = self.n2.x;
Please sign in to comment.
Something went wrong with that request. Please try again.