summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/gd/libgd/gd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 1ac09a76fc..66214dfe70 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1029,6 +1029,22 @@ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
return;
}
+ /* Vertical */
+ if (x1==x2) {
+ for (;y1 <= y2; y1++) {
+ gdImageSetPixel(im, x1,y1, color);
+ }
+ return;
+ }
+
+ /* Horizontal */
+ if (y1==y2) {
+ for (;x1 <= x2; x1++) {
+ gdImageSetPixel(im, x1,y1, color);
+ }
+ return;
+ }
+
/* gdAntiAliased passed as color: set anti-aliased line (AAL) global vars. */
if (color == gdAntiAliased) {
im->AAL_x1 = x1;