original_string: public function add_comment($text, $x, $y, $width, $colour = 'yellow') {
          if (!$this->filename) {
              return false;
          }
          $this->SetDrawColor(51, 51, 51);
          switch ($colour) {
              case 'red':
                  $this->SetFillColor(249, 181, 179);
                  break;
              case 'green':
                  $this->SetFillColor(214, 234, 178);
                  break;
              case 'blue':
                  $this->SetFillColor(203, 217, 237);
                  break;
              case 'white':
                  $this->SetFillColor(255, 255, 255);
                  break;
              default: /* Yellow */
                  $this->SetFillColor(255, 236, 174);
                  break;
          }
  
          $x *= $this->scale;
          $y *= $this->scale;
          $width *= $this->scale;
          $text = str_replace('&lt;', '<', $text);
          $text = str_replace('&gt;', '>', $text);
          // Draw the text with a border, but no background colour (using a background colour would cause the fill to
          // appear behind any existing content on the page, hence the extra filled rectangle drawn below).
          $this->MultiCell($width, 1.0, $text, 0, 'L', 0, 4, $x, $y); /* width, height, text, border, justify, fill, ln, x, y */
          if ($colour != 'clear') {
              $newy = $this->GetY();
              // Now we know the final size of the comment, draw a rectangle with the background colour.
              $this->Rect($x, $y, $width, $newy - $y, 'DF');
              // Re-draw the text over the top of the background rectangle.
              $this->MultiCell($width, 1.0, $text, 0, 'L', 0, 4, $x, $y); /* width, height, text, border, justify, fill, ln, x, y */
          }
          return true;
      }
code: public function add_comment($text, $x, $y, $width, $colour = 'yellow') {
          if (!$this->filename) {
              return false;
          }
          $this->SetDrawColor(51, 51, 51);
          switch ($colour) {
              case 'red':
                  $this->SetFillColor(249, 181, 179);
                  break;
              case 'green':
                  $this->SetFillColor(214, 234, 178);
                  break;
              case 'blue':
                  $this->SetFillColor(203, 217, 237);
                  break;
              case 'white':
                  $this->SetFillColor(255, 255, 255);
                  break;
              default: /* Yellow */
                  $this->SetFillColor(255, 236, 174);
                  break;
          }
  
          $x *= $this->scale;
          $y *= $this->scale;
          $width *= $this->scale;
          $text = str_replace('&lt;', '<', $text);
          $text = str_replace('&gt;', '>', $text);
          // Draw the text with a border, but no background colour (using a background colour would cause the fill to
          // appear behind any existing content on the page, hence the extra filled rectangle drawn below).
          $this->MultiCell($width, 1.0, $text, 0, 'L', 0, 4, $x, $y); /* width, height, text, border, justify, fill, ln, x, y */
          if ($colour != 'clear') {
              $newy = $this->GetY();
              // Now we know the final size of the comment, draw a rectangle with the background colour.
              $this->Rect($x, $y, $width, $newy - $y, 'DF');
              // Re-draw the text over the top of the background rectangle.
              $this->MultiCell($width, 1.0, $text, 0, 'L', 0, 4, $x, $y); /* width, height, text, border, justify, fill, ln, x, y */
          }
          return true;
      }
code_tokens: public function add_comment ( $ text , $ x , $ y , $ width , $ colour = 'yellow' ) { if ( ! $ this -> filename ) { return false ; } $ this -> SetDrawColor ( 51 , 51 , 51 ) ; switch ( $ colour ) { case 'red' : $ this -> SetFillColor ( 249 , 181 , 179 ) ; break ; case 'green' : $ this -> SetFillColor ( 214 , 234 , 178 ) ; break ; case 'blue' : $ this -> SetFillColor ( 203 , 217 , 237 ) ; break ; case 'white' : $ this -> SetFillColor ( 255 , 255 , 255 ) ; break ; default : /* Yellow */ $ this -> SetFillColor ( 255 , 236 , 174 ) ; break ; } $ x *= $ this -> scale ; $ y *= $ this -> scale ; $ width *= $ this -> scale ; $ text = str_replace ( '&lt;' , '<' , $ text ) ; $ text = str_replace ( '&gt;' , '>' , $ text ) ; // Draw the text with a border, but no background colour (using a background colour would cause the fill to // appear behind any existing content on the page, hence the extra filled rectangle drawn below). $ this -> MultiCell ( $ width , 1.0 , $ text , 0 , 'L' , 0 , 4 , $ x , $ y ) ; /* width, height, text, border, justify, fill, ln, x, y */ if ( $ colour != 'clear' ) { $ newy = $ this -> GetY ( ) ; // Now we know the final size of the comment, draw a rectangle with the background colour. $ this -> Rect ( $ x , $ y , $ width , $ newy - $ y , 'DF' ) ; // Re-draw the text over the top of the background rectangle. $ this -> MultiCell ( $ width , 1.0 , $ text , 0 , 'L' , 0 , 4 , $ x , $ y ) ; /* width, height, text, border, justify, fill, ln, x, y */ } return true ; }
docstring: Add a comment to the current page
  @param string $text the text of the comment
  @param int $x the x-coordinate of the comment (in pixels)
  @param int $y the y-coordinate of the comment (in pixels)
  @param int $width the width of the comment (in pixels)
  @param string $colour optional the background colour of the comment (red, yellow, green, blue, white, clear)
  @return bool true if successful (always)
docstring_tokens: Add a comment to the current page