Skip to content

Commit

Permalink
Fixes bug determining SVG dimensions in SMF\Graphics\Image
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
  • Loading branch information
Sesquipedalian committed Oct 25, 2024
1 parent 12d051e commit bcecdab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Graphics/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -959,16 +959,16 @@ protected function getSvgDimensions(): void
$vb_height = $matches[3];

// No dimensions given, so use viewBox dimensions.
if (!empty($width) && !empty($height)) {
if (!isset($width) && !isset($height)) {
$width = $vb_width;
$height = $vb_height;
}
// Width but no height, so calculate height.
elseif (!empty($width)) {
elseif (isset($width)) {
$height = $width * $vb_height / $vb_width;
}
// Height but no width, so calculate width.
elseif (!empty($height)) {
elseif (isset($height)) {
$width = $height * $vb_width / $vb_height;
}
}
Expand Down

0 comments on commit bcecdab

Please sign in to comment.