diff --git a/CHANGELOG.md b/CHANGELOG.md index fcaf1388..41f0c3ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3; new r - Header: All images added to the second header were assigned to the first header - @basjan GH-222 - Conversion: Fix conversion from cm to pixel, pixel to cm, and pixel to point - @basjan GH-233 GH-234 - PageBreak: Page break adds new line in the beginning of the new page - @ivanlanin GH-150 +- Image: `marginLeft` and `marginTop` cannot accept float value - @ivanlanin GH-248 ### Deprecated diff --git a/src/PhpWord/Style/Image.php b/src/PhpWord/Style/Image.php index 33c85ddf..f816b32f 100644 --- a/src/PhpWord/Style/Image.php +++ b/src/PhpWord/Style/Image.php @@ -102,14 +102,14 @@ class Image extends AbstractStyle /** * Margin Top * - * @var int + * @var int|float */ private $marginTop = 0; /** * Margin Left * - * @var int + * @var int|float */ private $marginLeft = 0; @@ -235,7 +235,7 @@ class Image extends AbstractStyle /** * Get margin top * - * @return int + * @return int|float */ public function getMarginTop() { @@ -245,12 +245,12 @@ class Image extends AbstractStyle /** * Set margin top * - * @param int $value + * @param int|float $value * @return self */ public function setMarginTop($value = 0) { - $this->marginTop = $this->setIntVal($value, 0); + $this->marginTop = $this->setFloatVal($value, 0); return $this; } @@ -258,7 +258,7 @@ class Image extends AbstractStyle /** * Get margin left * - * @return int + * @return int|float */ public function getMarginLeft() { @@ -268,12 +268,12 @@ class Image extends AbstractStyle /** * Set margin left * - * @param int $value + * @param int|float $value * @return self */ public function setMarginLeft($value = 0) { - $this->marginLeft = $this->setIntVal($value, 0); + $this->marginLeft = $this->setFloatVal($value, 0); return $this; }