--- loncom/homework/randomlabel.pm 2005/05/16 21:58:19 1.73 +++ loncom/homework/randomlabel.pm 2005/05/23 11:02:13 1.74 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # random labelling tool # -# $Id: randomlabel.pm,v 1.73 2005/05/16 21:58:19 foxr Exp $ +# $Id: randomlabel.pm,v 1.74 2005/05/23 11:02:13 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -174,16 +174,22 @@ sub end_bgimg { if ($src =~ /^\\graphicspath/) { - $height_param = $Apache::lonplot::plot{'height'}*0.3; - $width_param = $Apache::lonplot::plot{'width'}*0.3; + $height_param = $Apache::lonplot::plot{'height'}; + my $initial_width= $Apache::lonplot::plot{'width'}; + $width_param = $Apache::lonplot::plot{'texwidth'}; + $scale_factor = $width_param / $initial_width; + $height_param = $height_param*$scale_factor; &Apache::lonxml::debug("height $height_param"); &Apache::lonxml::debug("Width $width_param"); - $scale_factor=1.0; + my $dirty_width = $width_param + 5; $result .= '\parbox{'.$dirty_width.'mm}{'; - $result .= $src; + $result .= $src."\n"; + $result .= '\setlength{\unitlength}{1mm}'."\n"; $result .= '\begin{picture}('."$height_param,$width_param)"; $result .= "(0,-$height_param)"; + $result .= "\n"; + } else {