Skip to content

Commit

Permalink
PowerPoint2007 Writer : Outline : Fixed the base unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakku authored and Progi1984 committed Dec 4, 2023
1 parent ea33980 commit 0134fff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/changes/1.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@

- Fixed CI - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentation/pull/766)
- PowerPoint2077 Writer : Fixed broken PPT Presentations due to MS Office update 2309 - [@WFarmerEthisphere](https://github.com/WFarmerEthisphere) in [#770](https://github.com/PHPOffice/PHPPresentation/pull/770)
- PowerPoint2077 Writer : Fixed error when defining min/max bounds to 0 - [@LilyEssence](https://github.com/LilyEssence) in [#771](https://github.com/PHPOffice/PHPPresentation/pull/771)
- PowerPoint2077 Writer : Fixed error when defining min/max bounds to 0 - [@LilyEssence](https://github.com/LilyEssence) in [#771](https://github.com/PHPOffice/PHPPresentation/pull/771)
- PowerPoint2007 Writer : Outline : Fixed the base unit - [@Pakku](https://github.com/Pakku) in [#772](https://github.com/PHPOffice/PHPPresentation/pull/772)
11 changes: 7 additions & 4 deletions src/PhpPresentation/Style/Outline.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Outline
protected $fill;

/**
* @var float
* @var int
*/
protected $width = 1;

Expand All @@ -51,15 +51,18 @@ public function setFill(Fill $fill): self
return $this;
}

public function getWidth(): float
/**
* Value in pixels.
*/
public function getWidth(): int
{
return $this->width;
}

/**
* Value in points.
* Value in pixels.
*/
public function setWidth(float $pValue = 1): self
public function setWidth(int $pValue = 1): self
{
$this->width = $pValue;

Expand Down
2 changes: 1 addition & 1 deletion src/PhpPresentation/Writer/ODPresentation/ObjectsChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ protected function writeSeriesStyle(Chart $chart, Chart\Series $series): void
if ($oOutline instanceof Outline) {
$outlineWidth = $oOutline->getWidth();
if (!empty($outlineWidth)) {
$outlineWidth = number_format(CommonDrawing::pointsToCentimeters($outlineWidth), 3, '.', '');
$outlineWidth = number_format(CommonDrawing::pixelsToCentimeters($outlineWidth), 3, '.', '');
}
$outlineColor = $oOutline->getFill()->getStartColor()->getRGB();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected function writeOutline(XMLWriter $objWriter, ?Outline $oOutline): void
return;
}
// Width : pts
$width = CommonDrawing::pointsToEmu($oOutline->getWidth());
$width = CommonDrawing::pixelsToEmu($oOutline->getWidth());

// a:ln
$objWriter->startElement('a:ln');
Expand Down

0 comments on commit 0134fff

Please sign in to comment.