Accidental global functions

This commit is contained in:
Dennis Hotson 2013-03-19 21:41:01 +11:00
parent 5ed407c69d
commit 43f725e61a

View File

@ -57,14 +57,14 @@ jQuery.fn.springy = function(params) {
});
// convert to/from screen coordinates
toScreen = function(p) {
var toScreen = function(p) {
var size = currentBB.topright.subtract(currentBB.bottomleft);
var sx = p.subtract(currentBB.bottomleft).divide(size.x).x * canvas.width;
var sy = p.subtract(currentBB.bottomleft).divide(size.y).y * canvas.height;
return new Springy.Vector(sx, sy);
};
fromScreen = function(s) {
var fromScreen = function(s) {
var size = currentBB.topright.subtract(currentBB.bottomleft);
var px = (s.x / canvas.width) * size.x + currentBB.bottomleft.x;
var py = (s.y / canvas.height) * size.y + currentBB.bottomleft.y;