-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8e6bfe
commit 179f840
Showing
4 changed files
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
* @package PosterEditor | ||
* @author Anton Lukin <[email protected]> | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
* @version Release: 5.11 | ||
* @version Release: 5.12 | ||
* @link https://github.com/antonlukin/poster-editor | ||
*/ | ||
class PosterEditor | ||
|
@@ -774,7 +774,14 @@ public function text($text, $options = array(), &$boundary = array()) | |
$lines = explode(PHP_EOL, $text); | ||
|
||
// Set default boundary vaules. | ||
$boundary = array_merge(array('width' => 0, 'height' => 0)); | ||
$boundary = array_merge( | ||
array( | ||
'x' => $options['x'], | ||
'y' => $options['y'], | ||
'width' => 0, | ||
'height' => 0, | ||
) | ||
); | ||
|
||
foreach ($lines as $index => $line) { | ||
list($x, $y, $width, $height) = $this->getOffset($options, $lines, $index); | ||
|
@@ -785,10 +792,8 @@ public function text($text, $options = array(), &$boundary = array()) | |
// Draw single line | ||
$this->drawLine($line, $options, $width, $x, $y, $color, $last); | ||
|
||
$boundary = array( | ||
'width' => max($width, $boundary['width']), | ||
'height' => $boundary['height'] + $height, | ||
); | ||
$boundary['width'] = max($width, $boundary['width']); | ||
$boundary['height'] = $boundary['height'] + $height; | ||
} | ||
|
||
return $this; | ||
|