Esempio n. 1
0
 /**
  * Test get/set visible
  */
 public function testSetIsVisible()
 {
     $object = new Shadow();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setVisible());
     $this->assertFalse($object->isVisible());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setVisible(false));
     $this->assertFalse($object->isVisible());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setVisible(true));
     $this->assertTrue($object->isVisible());
 }
Esempio n. 2
0
 /**
  * Write Shadow
  * @param XMLWriter $objWriter
  * @param Shadow $oShadow
  */
 protected function writeShadow(XMLWriter $objWriter, $oShadow)
 {
     if (!$oShadow instanceof Shadow) {
         return;
     }
     if (!$oShadow->isVisible()) {
         return;
     }
     // a:effectLst
     $objWriter->startElement('a:effectLst');
     // a:outerShdw
     $objWriter->startElement('a:outerShdw');
     $objWriter->writeAttribute('blurRad', CommonDrawing::pixelsToEmu($oShadow->getBlurRadius()));
     $objWriter->writeAttribute('dist', CommonDrawing::pixelsToEmu($oShadow->getDistance()));
     $objWriter->writeAttribute('dir', CommonDrawing::degreesToAngle($oShadow->getDirection()));
     $objWriter->writeAttribute('algn', $oShadow->getAlignment());
     $objWriter->writeAttribute('rotWithShape', '0');
     $this->writeColor($objWriter, $oShadow->getColor(), $oShadow->getAlpha());
     $objWriter->endElement();
     $objWriter->endElement();
 }