Bugfix #248: Image: `marginLeft` and `marginTop` cannot accept float value

This commit is contained in:
Ivan Lanin 2014-05-27 00:46:18 +07:00
parent 92c7a24c38
commit d9a2c4c3ca
2 changed files with 9 additions and 8 deletions

View File

@ -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 - 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 - 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 - 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 ### Deprecated

View File

@ -102,14 +102,14 @@ class Image extends AbstractStyle
/** /**
* Margin Top * Margin Top
* *
* @var int * @var int|float
*/ */
private $marginTop = 0; private $marginTop = 0;
/** /**
* Margin Left * Margin Left
* *
* @var int * @var int|float
*/ */
private $marginLeft = 0; private $marginLeft = 0;
@ -235,7 +235,7 @@ class Image extends AbstractStyle
/** /**
* Get margin top * Get margin top
* *
* @return int * @return int|float
*/ */
public function getMarginTop() public function getMarginTop()
{ {
@ -245,12 +245,12 @@ class Image extends AbstractStyle
/** /**
* Set margin top * Set margin top
* *
* @param int $value * @param int|float $value
* @return self * @return self
*/ */
public function setMarginTop($value = 0) public function setMarginTop($value = 0)
{ {
$this->marginTop = $this->setIntVal($value, 0); $this->marginTop = $this->setFloatVal($value, 0);
return $this; return $this;
} }
@ -258,7 +258,7 @@ class Image extends AbstractStyle
/** /**
* Get margin left * Get margin left
* *
* @return int * @return int|float
*/ */
public function getMarginLeft() public function getMarginLeft()
{ {
@ -268,12 +268,12 @@ class Image extends AbstractStyle
/** /**
* Set margin left * Set margin left
* *
* @param int $value * @param int|float $value
* @return self * @return self
*/ */
public function setMarginLeft($value = 0) public function setMarginLeft($value = 0)
{ {
$this->marginLeft = $this->setIntVal($value, 0); $this->marginLeft = $this->setFloatVal($value, 0);
return $this; return $this;
} }