File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3; new r
36
36
- Header: All images added to the second header were assigned to the first header - @basjan GH-222
37
37
- Conversion: Fix conversion from cm to pixel, pixel to cm, and pixel to point - @basjan GH-233 GH-234
38
38
- PageBreak: Page break adds new line in the beginning of the new page - @ivanlanin GH-150
39
+ - Image: ` marginLeft ` and ` marginTop ` cannot accept float value - @ivanlanin GH-248
39
40
40
41
### Deprecated
41
42
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ protected function setFloatVal($value, $default = null)
245
245
if (is_string ($ value ) && (preg_match ('/[^\d\.\,]/ ' , $ value ) == 0 )) {
246
246
$ value = floatval ($ value );
247
247
}
248
- if (!is_float ($ value )) {
248
+ if (!is_numeric ($ value )) {
249
249
$ value = $ default ;
250
250
}
251
251
Original file line number Diff line number Diff line change @@ -102,14 +102,14 @@ class Image extends AbstractStyle
102
102
/**
103
103
* Margin Top
104
104
*
105
- * @var int
105
+ * @var int|float
106
106
*/
107
107
private $ marginTop = 0 ;
108
108
109
109
/**
110
110
* Margin Left
111
111
*
112
- * @var int
112
+ * @var int|float
113
113
*/
114
114
private $ marginLeft = 0 ;
115
115
@@ -235,7 +235,7 @@ public function setAlign($value = null)
235
235
/**
236
236
* Get margin top
237
237
*
238
- * @return int
238
+ * @return int|float
239
239
*/
240
240
public function getMarginTop ()
241
241
{
@@ -245,20 +245,20 @@ public function getMarginTop()
245
245
/**
246
246
* Set margin top
247
247
*
248
- * @param int $value
248
+ * @param int|float $value
249
249
* @return self
250
250
*/
251
251
public function setMarginTop ($ value = 0 )
252
252
{
253
- $ this ->marginTop = $ this ->setIntVal ($ value , 0 );
253
+ $ this ->marginTop = $ this ->setNumericVal ($ value , 0 );
254
254
255
255
return $ this ;
256
256
}
257
257
258
258
/**
259
259
* Get margin left
260
260
*
261
- * @return int
261
+ * @return int|float
262
262
*/
263
263
public function getMarginLeft ()
264
264
{
@@ -268,12 +268,12 @@ public function getMarginLeft()
268
268
/**
269
269
* Set margin left
270
270
*
271
- * @param int $value
271
+ * @param int|float $value
272
272
* @return self
273
273
*/
274
274
public function setMarginLeft ($ value = 0 )
275
275
{
276
- $ this ->marginLeft = $ this ->setIntVal ($ value , 0 );
276
+ $ this ->marginLeft = $ this ->setNumericVal ($ value , 0 );
277
277
278
278
return $ this ;
279
279
}
You can’t perform that action at this time.
0 commit comments