Code Duplication    Length = 5-7 lines in 2 locations

src/image/Image.php 2 locations

@@ 655-661 (lines=7) @@
652
        $fh = $this->GetFontHeight();
653
        $w  = $this->GetTextWidth($txt);
654
655
        if ($this->text_halign == "right") {
656
            $x -= $dir == 0 ? $w : $h;
657
        } elseif ($this->text_halign == "center") {
658
            // For center we subtract 1 pixel since this makes the middle
659
            // be prefectly in the middle
660
            $x -= $dir == 0 ? $w / 2 - 1 : $h / 2;
661
        }
662
        if ($this->text_valign == "top") {
663
            $y += $dir == 0 ? $h : $w;
664
        } elseif ($this->text_valign == "center") {
@@ 1011-1015 (lines=5) @@
1008
            $nl  = count($tmp);
1009
            $h   = $nl * $fh;
1010
1011
            if ($this->text_halign == 'right') {
1012
                $x -= $dir == 0 ? $w : $h;
1013
            } elseif ($this->text_halign == 'center') {
1014
                $x -= $dir == 0 ? $w / 2 : $h / 2;
1015
            }
1016
1017
            if ($this->text_valign == 'top') {
1018
                $y += $dir == 0 ? $h : $w;