Skip to content

Commit

Permalink
Typecast imagefocus.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Aug 25, 2023
1 parent cb950fc commit 497f9e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/php/Component/Segment/Segment.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ public function init()
$this->data['classList'][] = $this->getBaseClass() . '--content-background-' . $contentBackground;
}

if(is_object($imageFocus)) {
$imageFocus = (array) $imageFocus;
}

//Add background position to image styles
if (array_filter($imageFocus)) {
if (is_array($imageFocus) && array_filter((array) $imageFocus)) {
$this->data['imageStyle']['background-position'] = $imageFocus['left'] . "% " . $imageFocus['top'] . "%";
}

Expand Down

0 comments on commit 497f9e8

Please sign in to comment.