Exemple #1
0
 private static function getTranslatedPointOf(Node $node, Point $point)
 {
     $translation = $node->getPositionTranslation();
     return $point->translate($translation->getX(), $translation->getY());
 }
 protected function getTranslationAwareBoundary(Node $node, Boundary $boundary)
 {
     $positionTranslation = $node->getPositionTranslation();
     if ($positionTranslation && ($positionTranslation->getX() != 0 || $positionTranslation->getY() != 0)) {
         $boundary = clone $boundary;
         $boundary->translate($positionTranslation->getX(), $positionTranslation->getY());
     }
     return $boundary;
 }
Exemple #3
0
 private function drawCircleBorder(GraphicsContext $gc, Node $node, Document $document)
 {
     $size = $document->convertUnit($this->size);
     $gc->setLineWidth($size);
     $point = $node->getMiddlePoint();
     $translation = $node->getPositionTranslation();
     if (!$translation->isZero()) {
         $point = $point->translate($translation->getX(), $translation->getY());
     }
     $this->drawCircle($gc, $node->getAttribute('radius'), $point->getX(), $point->getY(), GraphicsContext::SHAPE_DRAW_STROKE);
 }
Exemple #4
0
 private function drawCircleBackground(GraphicsContext $gc, Node $node, Document $document)
 {
     $point = $node->getMiddlePoint();
     $translation = $node->getPositionTranslation();
     if (!$translation->isZero()) {
         $point = $point->translate($translation->getX(), $translation->getY());
     }
     $this->drawCircle($gc, $node->getAttribute('radius'), $point->getX(), $point->getY(), GraphicsContext::SHAPE_DRAW_FILL);
 }