/**
  * {@inheritdoc}
  */
 public function draw(CanvasInterface $canvas, Border $border, StyleInterface $style = null)
 {
     $rect = new Rectangle($canvas->getDimension());
     $color = $style ? $style->apply($canvas, $border) : $border->getColor();
     $rect->setColor($color)->setLineThickness($border->getSize())->draw($canvas);
     return $this;
 }
 /**
  * {@inheritdoc}
  */
 protected function doDraw(CanvasInterface $canvas, StyleInterface $style = null)
 {
     $x = $this->getCoordinate()->getX();
     $y = $this->getCoordinate()->getY();
     $isStyle = $style === null ? false : true;
     $color = $isStyle === true ? $style->apply($canvas, $this)->getValue() : $this->getColor()->getValue();
     if (false == @imagesetpixel($canvas->getHandler(), $x, $y, $color)) {
         throw new DrawableException(sprintf('Faild To Draw The Pixel At (%s)', (string) $this));
     }
     return $this;
 }