diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..090a1f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.DS_Store diff --git a/lib/effect_insert_text.php b/lib/effect_insert_text.php index 6d13596..7ce005a 100644 --- a/lib/effect_insert_text.php +++ b/lib/effect_insert_text.php @@ -95,22 +95,22 @@ public function execute() $position[1] = (string) $txtparams[4]; } - // Default Padding - $padding = [0, 30]; + // Default Margin + $margin = [0, 30]; // Padding if (isset($this->params['padding_x']) && $this->params['padding_x'] <> '') { - $padding[0] = (int) $this->params['padding_x']; + $margin[0] = (int) $this->params['padding_x']; } if (isset($txtparams[5]) && $txtparams[5] <> '') { - $padding[0] = (int) $txtparams[5]; + $margin[0] = (int) $txtparams[5]; } if (isset($this->params['padding_y']) && $this->params['padding_y'] <> '') { - $padding[1] = (int) $this->params['padding_y']; + $margin[1] = (int) $this->params['padding_y']; } if (isset($txtparams[6]) && $txtparams[6] <> '') { - $padding[1] = (int) $txtparams[6]; + $margin[1] = (int) $txtparams[6]; } // Antialiasing @@ -247,9 +247,6 @@ public function execute() // Write text shadow if ($outputshadow) { $col = imagecolorallocatealpha($gdTemp, $shadowcolor[0], $shadowcolor[1], $shadowcolor[2], $shadowalpha); - if ($antialiasing === 0) { - $col = -$col; - } imagettftext( $gdTemp, $fontSize * $scale, @@ -264,9 +261,6 @@ public function execute() // Write text $col = imagecolorallocatealpha($gdTemp, $color[0], $color[1], $color[2], $alpha); - if ($antialiasing === 0) { - $col = -$col; - } imagettftext( $gdTemp, $fontSize * $scale, @@ -285,8 +279,8 @@ public function execute() // get new Image-Size $imgWidth = imagesx($gdTemp); $imgHeight = imagesy($gdTemp); - $the_box['width'] = $imgWidth; - $the_box['height'] = $imgHeight; + $the_box['width'] = $imgWidth / $scale; + $the_box['height'] = $imgHeight / $scale; $bgpadding = 0; } @@ -324,8 +318,8 @@ public function execute() imagecopyresampled( $sourceImage, $gdTemp, - $dstX + $padding[0], - $dstY + $padding[1], + $dstX + $margin[0], + $dstY + $margin[1], 0, 0, $the_box['width'] + ($bgpadding*2), @@ -509,7 +503,7 @@ public function getParams() 'type' => 'select', 'options' => ['left', 'center', 'right'], 'default' => 'center', - ], + ], [ 'label' => rex_i18n::msg('media_manager_effect_insert_text_vpos'), 'name' => 'vpos', diff --git a/package.yml b/package.yml index b30a081..82ac32b 100644 --- a/package.yml +++ b/package.yml @@ -1,5 +1,5 @@ package: insert_text -version: "2.0.0" +version: "2.0.1" name: Insert Text author: Friends Of REDAXO supportpage: https://github.com/FriendsOfREDAXO/insert_text