!if  $wims_read_parm!=slib_header
 !goto proc
!endif
slib_title=Utility for a clickable graphic paper sheet
slib_parms=8\
8,x_dimension (cm) \
8,y_dimension (cm) \
1,x_orig (cm) \
1,y_orig (cm) \
1,x_step (delta x for 1 cm on the paper) \
1,y_step (delta y for 1 cm on the paper) \
0,click_x (from the mouse)\
0,click_y (from the mouse)
slib_author=Georges KHAZNADAR
slib_out= list of coordinates (x, y,) in the viewport space
slib_comment=for usage with Modtool, do not forget to declare\
click_x and click_y (as reply) in the file var.def, \
and do not forget to write a line '!set ins_tag=form click' before\
the command '!insdraw'. The 6 first parameters are the same as in\
slib/graphpaper/millimetre
slib_example= 12,8,0,0,1,1,125,13

 
!exit

:proc

!reset slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_xc, slib_yc, slib_x, slib_y

slib_parm=!item 1 to 8 of $wims_read_parm
!distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_xc, slib_yc

!default slib_xd=8
!default slib_yd=8
!default slib_xo=1
!default slib_yo=1
!default slib_xs=1
!default slib_ys=1
!default slib_xc=0
!default slib_yc=0


!!!!!! values from millimetre !!!!
!! new 60*$slib_xd,60*$slib_yd
!! xrange -0.5, 10*$slib_xd-0.5
!! yrange -0.5, 10*$slib_yd-0.5

slib_x=$[($slib_xc/60-0.05-$slib_xo)*$slib_xs]
slib_y=$[(-$slib_yc/60-0.05+$slib_yd-$slib_yo)*$slib_ys]

slib_out= $slib_x, $slib_y,
