]> granicus.if.org Git - php/commit
Fix #53154: Zero-height rectangle has whiskers
authorChristoph M. Becker <cmb@php.net>
Sun, 12 Jul 2015 23:29:01 +0000 (01:29 +0200)
committerChristoph M. Becker <cmb@php.net>
Sun, 12 Jul 2015 23:29:01 +0000 (01:29 +0200)
commitd87a3312e30931d0f6c2ea6a6ced13fc7b217e65
tree779271d342e46ffeb57e2e0547c4023ff9c57cd0
parentecd32e437e81270221092726eb1bdac6917994e0
Fix #53154: Zero-height rectangle has whiskers

To avoid drawing the corner pixels twice, gdImageRectangle() draws the vertical
lines 2 points shorter than the actual side of the rectangle. However, this
causes "whiskers" for rectangles with height 0. This patch fixes this issue and
at the same time optimizes the algorithm by drawing only a single line for zero
height and zero width rectangles.
ext/gd/libgd/gd.c
ext/gd/tests/bug53154.phpt [new file with mode: 0644]