
!for i=1 to $drawcnt
 l=!line $i of $drawlist
 !distribute items $l into type,number,p1,p2
 !if $type iswordof random middle
  type=point
 !endif
 !if $type=midper
  type=line
 !endif
 obj=!line $number of $(draw$type)
 !distribute items $obj into t1,t2,t3,t4,t5,t6
 !default t5=1
 
 !if $type=point
  x=$[rint(($t1-($stx))*$prop)]
  y=$[rint(($t2-($sty))*$prop)]
  !if $x<=1 or $y<=1 or $x>=$size or $y>=$size
   !goto cont
  !endif
  draw_src=$draw_src\
fcircle $x,$y,6,$drawcolor
  !if $shownum!=no
   draw_src=$draw_src\
string $drawcolor,$[$x+5],$[$y-4],tiny,$number
  !endif
  !goto cont
 !endif
 
 !if $type=line
  !distribute item $obj into x_,y_,u_,v_
  !if $t5>1
   m_=$[4*$pic_range/(abs($x_-($u_))+abs($y_-($v_)))]
   !if $t5=2 or $t5=4
    x_=$[($m_+1)*($t1)-$m_*($t3)]
    y_=$[($m_+1)*($t2)-$m_*($t4)]
   !endif
   !if $t5=2 or $t5=3
    u_=$[($m_+1)*($t3)-$m_*($t1)]
    v_=$[($m_+1)*($t4)-$m_*($t2)]
   !endif
   !if $t5=4
    u_=$t1
    v_=$t2
   !endif
  !endif
  t=line $[rint(($x_-($stx))*$prop)],$[rint(($y_-($sty))*$prop)],$[rint(($u_-($stx))*$prop)],$[rint(($v_-($sty))*$prop)],$drawcolor
  draw_src=$draw_src\
$t
  !goto cont
 !endif
 
 !if $type=circle
  x=$[rint(($t1-($stx))*$prop)]
  y=$[rint(($t2-($sty))*$prop)]
  r=$[rint(2*$t3*$prop+2)]
  !if $x+$r<=1 or $y+$r<=1 or $x-$r>=$size or $y-$r>=$size
   !goto cont
  !endif
  t=circle $x,$y,$r,$drawcolor
  draw_src=$draw_src\
$t
  !goto cont
 !endif
 
 :cont
!next i

