Tidied up comments from code review
This commit is contained in:
parent
fd1cd6ba49
commit
b373d7ead6
11
springyui.js
11
springyui.js
|
@ -84,8 +84,6 @@ jQuery.fn.springy = function(params) {
|
|||
selected = nearest = dragged = layout.nearest(p);
|
||||
|
||||
if (selected.node !== null) {
|
||||
// Part of the same bug mentioned later. Store the previous mass
|
||||
// before upscaling it for dragging.
|
||||
dragged.point.m = 10000.0;
|
||||
|
||||
if (nodeSelected) {
|
||||
|
@ -110,9 +108,6 @@ jQuery.fn.springy = function(params) {
|
|||
});
|
||||
|
||||
jQuery(window).bind('mouseup',function(e) {
|
||||
// Bug! Node's mass isn't reset on mouseup. Nodes which have been
|
||||
// dragged don't repulse very well. Store the initial mass in mousedown
|
||||
// and then restore it here.
|
||||
dragged = null;
|
||||
});
|
||||
|
||||
|
@ -133,7 +128,6 @@ jQuery.fn.springy = function(params) {
|
|||
};
|
||||
|
||||
Node.prototype.getHeight = function() {
|
||||
// Magic number with no explanation.
|
||||
return 20;
|
||||
};
|
||||
|
||||
|
@ -208,7 +202,6 @@ jQuery.fn.springy = function(params) {
|
|||
ctx.stroke();
|
||||
|
||||
// arrow
|
||||
|
||||
if (directional) {
|
||||
ctx.save();
|
||||
ctx.fillStyle = stroke;
|
||||
|
@ -225,7 +218,6 @@ jQuery.fn.springy = function(params) {
|
|||
}
|
||||
|
||||
// label
|
||||
|
||||
if (typeof(edge.data.label) !== 'undefined') {
|
||||
text = edge.data.label
|
||||
ctx.save();
|
||||
|
@ -246,7 +238,7 @@ jQuery.fn.springy = function(params) {
|
|||
var boxWidth = node.getWidth();
|
||||
var boxHeight = node.getHeight();
|
||||
|
||||
// fill background
|
||||
// clear background
|
||||
ctx.clearRect(s.x - boxWidth/2, s.y - 10, boxWidth, 20);
|
||||
|
||||
// fill background
|
||||
|
@ -257,7 +249,6 @@ jQuery.fn.springy = function(params) {
|
|||
} else {
|
||||
ctx.fillStyle = "#FFFFFF";
|
||||
}
|
||||
|
||||
ctx.fillRect(s.x - boxWidth/2, s.y - 10, boxWidth, 20);
|
||||
|
||||
ctx.textAlign = "left";
|
||||
|
|
Loading…
Reference in New Issue
Block a user