예제 #1
0
 /**
  * Removes a diagram object from the grid
  * @param string $id Id of the diagram object
  * @return null
  */
 public function removeDiagramObject($id)
 {
     $object = $this->getDiagramObject($id);
     $dimension = $object->getDimension();
     $cellsX = ceil($dimension->getWidth() / $this->cellDimension->getWidth());
     $cellsY = ceil($dimension->getHeight() / $this->cellDimension->getHeight());
     for ($i = 0; $i < $cellsX; $i++) {
         $loopX = $i + $x;
         for ($j = 0; $j < $cellsY; $j++) {
             unset($this->grid[$loopX][$loopY]);
         }
     }
     $object->setGridPoint(null);
     $object->setGridDimension(null);
     unset($this->objects[$id]);
 }
예제 #2
0
 /**
  * Fills a ellipse on the image
  * @param Point $center Point of the ellipse center
  * @param Dimension $dimension Dimension of the ellipse
  * @param Color $color
  * @return null
  */
 public function fillEllipse(Point $center, Dimension $dimension, Color $color)
 {
     $color = $this->allocateColor($color);
     $x = $center->getX();
     $y = $center->getY();
     $width = $dimension->getWidth();
     $height = $dimension->getHeight();
     imageFilledEllipse($this->resource, $x, $y, $width, $height, $color);
 }