version 1.8, 2001/12/04 15:17:56
|
version 1.12, 2002/02/05 16:21:03
|
Line 94 sub start_randomlabel {
|
Line 94 sub start_randomlabel {
|
$result.="<applet code=\"$code\" codebase=\"$codebase\" width=\"$w\" height=\"$h\">"; |
$result.="<applet code=\"$code\" codebase=\"$codebase\" width=\"$w\" height=\"$h\">"; |
$result.="<param name=\"bgimg\" value=\"$bgimg\">"; |
$result.="<param name=\"bgimg\" value=\"$bgimg\">"; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$bgimg=~s/(.gif|.jpg)$/.ps/; |
$bgimg=~s/(.gif|.jpg)$/.eps/; |
$result.='\vspace*{2mm} \\ \noindent \epsfxsize='.$texwidth.' \epsffile{'. |
$bgimg=~s/http:\/\/[^\/]*/\/home\/httpd\/html/; |
$bgimg.'}\setlength{\unitlength}{1mm} \\ \begin{picture}(0,0)(0,-5)'; |
$result.='\vspace*{2mm} \noindent \epsfxsize='.$texwidth.' mm \epsffile{'. |
|
$bgimg.'}\setlength{\unitlength}{1mm} \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')' |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::text_arg('Image:','bgimg',$token,75).'<br />'. |
$result.=&Apache::edit::text_arg('Image:','bgimg',$token,75).'<br />'. |
Line 244 sub end_labelgroup {
|
Line 245 sub end_labelgroup {
|
my $x = $Apache::randomlabel::xcoord[$i]; |
my $x = $Apache::randomlabel::xcoord[$i]; |
my $y = $Apache::randomlabel::ycoord[$i]; |
my $y = $Apache::randomlabel::ycoord[$i]; |
my $value = $Apache::randomlabel::value[$i]; |
my $value = $Apache::randomlabel::value[$i]; |
my $tcX=$x*($texwidth/$wwidth); |
my $tcX=$x*($texwidth/$wwidth) - $texwidth; |
my $tcY=$TY1-$y*($TY1/$wheight)-2; |
my $tcY=$TY1-$y*($TY1/$wheight)-2; |
$tcX=sprintf('%.2f',$tcX); |
$tcX=sprintf('%.2f',$tcX); |
$tcY=sprintf('%.2f',$tcY); |
$tcY=sprintf('%.2f',$tcY); |