@@ -61,6 +61,7 @@ class Image extends AbstractStyle
61
61
const POSITION_RELATIVE_TO_PAGE = 'page ' ;
62
62
const POSITION_RELATIVE_TO_COLUMN = 'column ' ; // horizontal only
63
63
const POSITION_RELATIVE_TO_CHAR = 'char ' ; // horizontal only
64
+ const POSITION_RELATIVE_TO_TEXT = 'text ' ; // vertical only
64
65
const POSITION_RELATIVE_TO_LINE = 'line ' ; // vertical only
65
66
const POSITION_RELATIVE_TO_LMARGIN = 'left-margin-area ' ; // horizontal only
66
67
const POSITION_RELATIVE_TO_RMARGIN = 'right-margin-area ' ; // horizontal only
@@ -103,14 +104,14 @@ class Image extends AbstractStyle
103
104
*
104
105
* @var int
105
106
*/
106
- private $ marginTop ;
107
+ private $ marginTop = 0 ;
107
108
108
109
/**
109
110
* Margin Left
110
111
*
111
112
* @var int
112
113
*/
113
- private $ marginLeft ;
114
+ private $ marginLeft = 0 ;
114
115
115
116
/**
116
117
* Wrapping style
@@ -247,9 +248,9 @@ public function getMarginTop()
247
248
* @param int $value
248
249
* @return self
249
250
*/
250
- public function setMarginTop ($ value = null )
251
+ public function setMarginTop ($ value = 0 )
251
252
{
252
- $ this ->marginTop = $ value ;
253
+ $ this ->marginTop = $ this -> setIntVal ( $ value, 0 ) ;
253
254
254
255
return $ this ;
255
256
}
@@ -270,9 +271,9 @@ public function getMarginLeft()
270
271
* @param int $value
271
272
* @return self
272
273
*/
273
- public function setMarginLeft ($ value = null )
274
+ public function setMarginLeft ($ value = 0 )
274
275
{
275
- $ this ->marginLeft = $ value ;
276
+ $ this ->marginLeft = $ this -> setIntVal ( $ value, 0 ) ;
276
277
277
278
return $ this ;
278
279
}
@@ -352,7 +353,7 @@ public function setPosHorizontal($alignment)
352
353
{
353
354
$ enum = array (
354
355
self ::POSITION_HORIZONTAL_LEFT , self ::POSITION_HORIZONTAL_CENTER ,
355
- self ::POSITION_HORIZONTAL_RIGHT ,
356
+ self ::POSITION_HORIZONTAL_RIGHT , self :: POSITION_ABSOLUTE
356
357
);
357
358
$ this ->posHorizontal = $ this ->setEnumVal ($ alignment , $ enum , $ this ->posHorizontal );
358
359
@@ -381,7 +382,7 @@ public function setPosVertical($alignment)
381
382
$ enum = array (
382
383
self ::POSITION_VERTICAL_TOP , self ::POSITION_VERTICAL_CENTER ,
383
384
self ::POSITION_VERTICAL_BOTTOM , self ::POSITION_VERTICAL_INSIDE ,
384
- self ::POSITION_VERTICAL_OUTSIDE ,
385
+ self ::POSITION_VERTICAL_OUTSIDE , self :: POSITION_ABSOLUTE
385
386
);
386
387
$ this ->posVertical = $ this ->setEnumVal ($ alignment , $ enum , $ this ->posVertical );
387
388
@@ -439,7 +440,7 @@ public function setPosVerticalRel($relto)
439
440
{
440
441
$ enum = array (
441
442
self ::POSITION_RELATIVE_TO_MARGIN , self ::POSITION_RELATIVE_TO_PAGE ,
442
- self ::POSITION_RELATIVE_TO_LINE ,
443
+ self ::POSITION_RELATIVE_TO_TEXT , self :: POSITION_RELATIVE_TO_LINE ,
443
444
self ::POSITION_RELATIVE_TO_TMARGIN , self ::POSITION_RELATIVE_TO_BMARGIN ,
444
445
self ::POSITION_RELATIVE_TO_IMARGIN , self ::POSITION_RELATIVE_TO_OMARGIN ,
445
446
);
0 commit comments