[javascript-dev] Re: horizontal slider
Emmanuel Jourdan
c74-mailinglists at e--j.com
Mon Sep 17 14:21:18 MDT 2007
- Previous message: [javascript-dev] Re: horizontal slider
- Next message: [javascript-dev] Re: Re: horizontal slider
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 17 sept. 07, at 20:34, Garrett Lynch wrote:
> Hi
>
> thanks for this, definitely seems to work better than mine but the
> slider itself doesn't seem to follow the cursor pixel for pixel at
> ether end of the slider - does it need some sort of offset??
Then it's 80 % of the aspect ;-)
function ondrag(x,y,but,cmd,shift,capslock,option,ctrl)
{
var f,a, height, width, aspect;
height = box.rect[3] - box.rect[1];
width = box.rect[2] - box.rect[0];
aspect = width/height;
aspect *= 0.8; // 80 % of the aspect
a = sketch.screentoworld(x,y);
//detect horizontal movement
f = (a[0] + aspect) / (2*aspect);
msg_float(f); //set new value with clipping + refresh
}
Cheers,
ej
- Previous message: [javascript-dev] Re: horizontal slider
- Next message: [javascript-dev] Re: Re: horizontal slider
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
