Logo Search packages:      
Sourcecode: acidbase version File versions  Download package

Cpdf::setLineStyle ( width = 1,
cap = '',
join = '',
dash = '',
phase = 0 
)

this sets the line drawing style. width, is the thickness of the line in user units cap is the type of cap to put on the line, values can be 'butt','round','square' where the diffference between 'square' and 'butt' is that 'square' projects a flat end past the end of the line. join can be 'miter', 'round', 'bevel' dash is an array which sets the dash pattern, is a series of length values, which are the lengths of the on and off dashes. (2) represents 2 on, 2 off, 2 on , 2 off ... (2,1) is 2 on, 1 off, 2 on, 1 off.. etc phase is a modifier on the dash pattern which is used to shift the point at which the pattern starts.

Definition at line 1789 of file class.pdf.php.

                                                                  {

  // this is quite inefficient in that it sets all the parameters whenever 1 is changed, but will fix another day
  $string = '';
  if ($width>0){
    $string.= $width.' w';
  }
  $ca = array('butt'=>0,'round'=>1,'square'=>2);
  if (isset($ca[$cap])){
    $string.= ' '.$ca[$cap].' J';
  }
  $ja = array('miter'=>0,'round'=>1,'bevel'=>2);
  if (isset($ja[$join])){
    $string.= ' '.$ja[$join].' j';
  }
  if (is_array($dash)){
    $string.= ' [';
    foreach ($dash as $len){
      $string.=' '.$len;
    }
    $string.= ' ] '.$phase.' d';
  }
  $this->currentLineStyle = $string;
  $this->objects[$this->currentContents]['c'].="\n".$string;
}

Generated by  Doxygen 1.6.0   Back to index