|
This should work.
inchesperpx = 1/72; // should be altered to whatever the correct value is
acc = 2; // number of decimal places in reading
dist = Math.abs(oldX - mio.mouse.x()) + Math.abs(oldY - mio.mouse.y());
dpx+=dist;
dinches = Math.round(dpx*inchesperpx*Math.pow(10,acc))/Math.pow(10,acc);
inches.innerHTML = dinches +" inches";
oldX = mio.mouse.x();
oldY = mio.mouse.y();
Rufo.
Last edited by Kyrnt; 07-23-2004 at 05:56 PM..
|