Re: Bug #11917: imageDashedLine() only seems to draw vertical lines
| From: | (repe) | Date: | Fri, 06 Jul 2001 06:03:41 +0000 |
| Subject: | Re: Bug #11917: imageDashedLine() only seems to draw vertical lines | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-59043@lists.php.net to get a copy of this message | ||
I complained about this too, a while ago (bug 11663).
The way it works in 4.0.6 is using imagesetstyle
with imageline, this is in new documentation at
imagedashedline.
However, IMHO:
<<steam>>
A function should not suddenly stop working. It either
should be dropped, or should continue to work as before.
At least not between minor releases. At least not without
_any_ warnings in release notes. (A mention about GD library
version change is not enough)
<</steam>>
I worked around it with this (my client still has 4.0.5, I upgraded
to 4.0.6):
function MDashedLine($image, $x0, $y0, $x1, $y1, $fg, $bg)
{
if (PHP_VERSION == "4.0.5") {
ImageDashedLine($image, $x0, $y0, $x1, $y1, $fg);
}
else {
$st = array($fg, $fg, $fg, $fg, $bg, $bg, $bg, $bg);
ImageSetStyle($image, $st);
ImageLine($image, $x0, $y0, $x1, $y1, IMG_COLOR_STYLED);
}
} // MDashedLine