You are here

public function TextimageTextbox::set in Textimage 7.3

Property setter.

Parameters

string $property: property name

mixed $value: property value

array $options: optional input

File

classes/TextimageTextbox.inc, line 41
Textimage - Font textbox management class.

Class

TextimageTextbox
Textimage - Font textbox management class.

Code

public function set($property, $value, $options = array()) {
  $this->{$property} = $value;
  switch ($property) {
    case 'width':
      $this->points[2] = $this->points[4] = $this->points[0] + $value - 1;
      break;
    case 'height':
      $this->points[1] = $this->points[3] = $this->points[7] + $value - 1;
      break;
    case 'points':
      $this->basepoint = array(
        0,
        0,
      );

      // Note: there is no check whether the points are actually representing
      // a rectangle.
      // Translate box to top left = 0,0.
      $this
        ->translateBoxPoints(array(
        -$this->points[6],
        -$this->points[7],
      ));

      // Set width and height.
      $this->width = $this->points[2] + 1;
      $this->height = $this->points[3] + 1;
      break;
  }
}