summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-29 23:12:26 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-29 23:12:26 +0000
commit4439ca94a9850261d7f27d06c8327eafe0ff1ea3 (patch)
tree9a6e80a2cc93f88c0787b53cdb9a237f53390765 /core/helpers
parentf5136051c902f88f9800697d48b35e2e908a5c22 (diff)
Don't let the x/y coordinates in composite go negative.
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/graphics.php8
1 files changed, 4 insertions, 4 deletions
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;