]> 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:33:00 +0000 (01:33 +0200)
commit094decc3c0b62a72bacebaf85c6269049bf12885
tree893b5edf3e8af0df52a5d5030b48f159b43526df
parent591fd4cdc3429931951ec08c7e5edd7af6e1c916
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]