From 4439ca94a9850261d7f27d06c8327eafe0ff1ea3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 29 Dec 2008 23:12:26 +0000 Subject: Don't let the x/y coordinates in composite go negative. --- core/helpers/graphics.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/helpers') diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index 0b5c2cd3..1354446c 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -146,10 +146,10 @@ class graphics_Core { $pad = 10; $top = $pad; $left = $pad; - $y_center = $height / 2 - $w_height / 2; - $x_center = $width / 2 - $w_width / 2; - $bottom = $height - $w_height - $pad; - $right = $width - $w_width - $pad; + $y_center = max($height / 2 - $w_height / 2, $pad); + $x_center = max($width / 2 - $w_width / 2, $pad); + $bottom = max($height - $w_height - $pad, $pad); + $right = max($width - $w_width - $pad, $pad); switch ($options["position"]) { case "northwest": $x = $left; $y = $top; break; -- cgit v1.2.3