x0 = $x0; $this->y0 = $y0; $this->x1 = $x1; $this->y1 = $y1; // Switch values to ensure correct order if ( $this->x0 > $this->x1 ) { $tmp = $this->x0; $this->x0 = $this->x1; $this->x1 = $tmp; } if ( $this->y0 > $this->y1 ) { $tmp = $this->y0; $this->y0 = $this->y1; $this->y1 = $tmp; } } /** * Getter for calculated values depending on the boundings. * - 'width': Width of bounding recangle * - 'height': Height of bounding recangle * * @param string $name Name of property to get * @return mixed Calculated value */ public function __get( $name ) { switch ( $name ) { case 'width': return $this->x1 - $this->x0; case 'height': return $this->y1 - $this->y0; default: throw new ezcBasePropertyNotFoundException( $name ); } } } ?>