Skip to content

Commit

Permalink
MEP compatibilité PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
elegret committed Feb 24, 2023
1 parent b51f7ee commit 87b68d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/image/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,8 @@ public function _StrokeTTF($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox,
}
}

$x = (int) round($x);
$y = (int) round($y);
$x = intval(round($x));
$y = intval(round($y));

imagettftext(
$this->img,
Expand Down Expand Up @@ -1152,8 +1152,8 @@ public function _StrokeTTF($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox,
$yl = $y - $yadj;
//$xl = $xl- $xadj;

$xl = (int) round($xl);
$yl = (int) round($yl - ($h - $fh) + $fh * $i);
$xl = intval(round($xl));
$yl = intval(round($yl - ($h - $fh) + $fh * $i));

imagettftext(
$this->img,
Expand Down Expand Up @@ -1608,7 +1608,7 @@ public function FilledPolygon($pts)
}
$old = $this->line_weight;
imagesetthickness($this->img, 1);
imagefilledpolygon($this->img, $pts, safe_count($pts) / 2, $this->current_color);
imagefilledpolygon($this->img, $pts, $this->current_color);
$this->line_weight = $old;
imagesetthickness($this->img, $old);
}
Expand Down Expand Up @@ -1979,7 +1979,7 @@ public function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color)
$p4y = ceil(($y1 - $dist_y));

$array = [$p1x, $p1y, $p2x, $p2y, $p3x, $p3y, $p4x, $p4y];
imagefilledpolygon($im, $array, (safe_count($array) / 2), $color);
imagefilledpolygon($im, $array, $color);

// for antialias
imageline($im, $p1x, $p1y, $p2x, $p2y, $color);
Expand Down Expand Up @@ -2042,7 +2042,7 @@ public function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color)
}

imagesetthickness($im, 1);
imagefilledpolygon($im, $pts, safe_count($pts) / 2, $color);
imagefilledpolygon($im, $pts, $color);

$weight *= 2;

Expand Down
6 changes: 3 additions & 3 deletions src/util/DateLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public function Set($aLocale)
}

$this->iLocale = $aLocale;
for ($i = 0, $ofs = 0 - strftime('%w'); $i < 7; $i++, $ofs++) {
$day = strftime('%a', strtotime("${ofs} day"));
for ($i = 0, $ofs = 0 - date('w'); $i < 7; $i++, $ofs++) {
$day = date('D', strtotime("${ofs} day"));
$day[0] = strtoupper($day[0]);
$this->iDayAbb[$aLocale][] = $day[0];
$this->iShortDay[$aLocale][] = $day;
}

for ($i = 1; $i <= 12; ++$i) {
list($short, $full) = explode('|', strftime('%b|%B', strtotime("2001-${i}-01")));
list($short, $full) = explode('|', date('M|F', strtotime("2001-${i}-01")));
$this->iShortMonth[$aLocale][] = ucfirst($short);
$this->iMonthName[$aLocale][] = ucfirst($full);
}
Expand Down

0 comments on commit 87b68d0

Please sign in to comment.