Hi Ted,
The Miter Limit is not an angle, it is a limit on the ratio between how
far the miter can extend from the path to the linewidth. This is
described in the class comments for BasicStroke.
If the default limit of 10 limits the angles to 11 degrees then your
supplied value of 90 will allow angles much sharper than that (since it
is allowing the miter to extend relatively further out than the
default).
If you want the cutoff to be somewhere in the vicinity of 90 degrees
then you need to calculate how far the miter extends on a 90 degree
angle compared to the linewidth and I think you get sqrt(2) if I'm not
mistaken. The lowest value allowed is 1.0 which is the ratio you get
for collinear line segments...
...jim
--On Thursday, December 5, 2002 9:37 AM -0600 Ted Hill
<[EMAIL PROTECTED]> wrote:
Hello,
I am stroking a general path with a basic stroke created as follows:
final float MITER_LIMIT_ANGLE = 90.0f;
BasicStroke stroke = new BasicStroke(strokeWidth,
BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, MITER_LIMIT_ANGLE);
I interpret the documentation at BasicStroke to mean that if an angle
is less than my MITER_LIMIT_ANGLE, that a JOIN_BEVEL will be used
instead of a JOIN_MITER.
However, I have a figure (see attached jpeg) with an angle less than
90 degrees and the miter is still used rather than the bevel.
In the bug parade, #4198113 deals with this issue but seems to
indicate that there is no bug.
In the attached jpeg there are four figures, the two rectangles are
bounding boxes, ignore these. Inside the larger bounding box is an
area that was constructed by adding a stroked shape to the area of
the figure in the inner bounding box. What I would expect is that the
join at the upper left of the larger figure would have a beveled
(flattened) 'corner' rather than the sharp miter.
I am working with JDK 1.3.x on Windows 2000.
Thank you,
Ted Hill
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".