XML Feeds

.

[javascript-dev] Re: Re: screentoworld misunderstanding

Emmanuel Jourdan c74-mailinglists at e--j.com
Fri Nov 9 12:56:36 MST 2007


On 9 nov. 07, at 19:35, gusanomaxlist wrote:

> Thanx for your hints.
> Here is the code:

Something like that?

function ondrag(x,y,...)
{
	var f,a,v,dx;
	a = sketch.screentoworld(x,y);
	v = (a[0]+aspect)/aspect*0.5;
	dx = v - last_x; //(last_x is initiated with 0)

	if (shift)
		dx *= 0.2;

	f = v - dx;

	msg_float(f);
	last_x = v;
}

ej



More information about the javascript-dev mailing list