PhpOffice\PhpPresentation\Writer\ODPresentation\Content::writeLineStyle PHP Method

writeLineStyle() public method

Write the default style information for a Line shape.
public writeLineStyle ( PhpOffice\Common\XMLWriter $objWriter, Line $shape )
$objWriter PhpOffice\Common\XMLWriter
$shape PhpOffice\PhpPresentation\Shape\Line
    public function writeLineStyle(XMLWriter $objWriter, Line $shape)
    {
        // style:style
        $objWriter->startElement('style:style');
        $objWriter->writeAttribute('style:name', 'gr' . $this->shapeId);
        $objWriter->writeAttribute('style:family', 'graphic');
        $objWriter->writeAttribute('style:parent-style-name', 'standard');
        // style:graphic-properties
        $objWriter->startElement('style:graphic-properties');
        $objWriter->writeAttribute('draw:fill', 'none');
        switch ($shape->getBorder()->getLineStyle()) {
            case Border::LINE_NONE:
                $objWriter->writeAttribute('draw:stroke', 'none');
                break;
            case Border::LINE_SINGLE:
                $objWriter->writeAttribute('draw:stroke', 'solid');
                break;
            default:
                $objWriter->writeAttribute('draw:stroke', 'none');
                break;
        }
        $objWriter->writeAttribute('svg:stroke-color', '#' . $shape->getBorder()->getColor()->getRGB());
        $objWriter->writeAttribute('svg:stroke-width', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::pointsToPixels($shape->getBorder()->getLineWidth())), 3) . 'cm');
        $objWriter->endElement();
        $objWriter->endElement();
    }