Skip to content

Shadow does not work with autoshape #736

@pengkong

Description

@pengkong

Shadow does not work with AutoShape

use PhpOffice\PhpPresentation\Shape\AutoShape;
...
$autoShape = new AutoShape();
$autoShape->setType(AutoShape::TYPE_ROUNDED_RECTANGLE)
    ->setWidthAndHeight(160, 90)
    ->setOffsetX(10)
    ->setOffsetY(10);
$autoShape->getFill()
    ->setFillType(Fill::FILL_SOLID)
    ->setStartColor(new Color('FFF5B356'));
$autoShape->getShadow()
    ->setVisible(true)
    ->setDirection(45)
    ->setDistance(5);
$slide->addShape($autoShape);

but it works for RichTextShape

$shape = $slide->createRichTextShape()
    ->setWidthAndHeight(160, 90)
    ->setOffsetX(10)
    ->setOffsetY(10);
$shape->getFill()
    ->setFillType(Fill::FILL_SOLID)
    ->setStartColor(new Color('FFF5B356'));
$shape->getShadow()
    ->setVisible(true)
    ->setAlpha(5)
    ->setDirection(45)
    ->setDistance(5);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions