Thick stroke join bug
Posted: 2007-05-24T04:37:56-07:00
I think I've found a bug with drawing joins. I've searched and not seen any previous mention, so it may be new, or alternatively I may not have been using the right search words.
IM reports its version as:
Version: ImageMagick 6.3.0 11/30/06 Q16
Here is demo code:
The error is at the bottom right, on the concave side of the join.
What I think is happening is that the line angles are being read from the apex of the lines to form the mitre.
The lines are then assumed to be straight, so the next line segment is drawn off parallel to this.
If the line curves away, this is a problem, it ought to track the shape.
The issue is symmetrical in that it doesn't matter which way through the join the path goes.
I hope that makes sense.
I understand that the line drawing code is particularly hairy, and also the drawing commands are a fairly low priority for you, but hope that reporting bugs is still useful.
IM reports its version as:
Version: ImageMagick 6.3.0 11/30/06 Q16
Here is demo code:
Code: Select all
#!/usr/bin/perl -w
#demo of thick line corner drawing bug
use Image::Magick;
$image=Image::Magick->new;
$width=200;$height=200;
$image->Set(size=>"${width}x$height");
$image->ReadImage('xc:white');
$points="M40 40 H140 c80 40 -80 80 0 120H 40";
$image->Draw(primitive=>'path',points=>$points,
stroke=>'blue',
strokewidth=>20,
antialias=>'true');
$filename = "image.gif";
open(IMAGE, ">$filename");
$image->Write(file=>\*IMAGE, filename=>$filename);
close(IMAGE);
undef $image;
exit(0);
What I think is happening is that the line angles are being read from the apex of the lines to form the mitre.
The lines are then assumed to be straight, so the next line segment is drawn off parallel to this.
If the line curves away, this is a problem, it ought to track the shape.
The issue is symmetrical in that it doesn't matter which way through the join the path goes.
I hope that makes sense.
I understand that the line drawing code is particularly hairy, and also the drawing commands are a fairly low priority for you, but hope that reporting bugs is still useful.