I figured it out. Actually your first code was close to what should have been done, though i only notice that after i achieved it.
mousewheel up:
Code:
if zoom<6 then begin
zoom:=zoom*1.1;
moved.x:=round(moved.x+(moved.x+pt.x)*0.1) ;
moved.y:=round(moved.y+(moved.y+pt.y)*0.1);
end;
mousewheel down:
Code:
if zoom>0.02 then begin
zoom:=zoom*10/11;
moved.x:=round(moved.x+(moved.x+pt.x)*(10/11-1)) ;
moved.y:=round(moved.y+(moved.y+pt.y)*(10/11-1));
end;
Thanks a lot for your time! Appreciate.
edit: pt.x and pt.y is the mouse position.
Bookmarks