> Daniel wrote:

> Given a GeneralPath with various line/quad/curve nodes, how do you
> calculate the bounds of the shape? The getBounds2D method returns a
> value that includes the location of the control points. Various bugs
> have been reported and all seem closed as not a bug. One (I can't
> recall the bug number) had a workaround "calculate it yourself".
> Unfortunately, I don't know how.

        Using the control points to calculate _a_ bounding box of a curve
always works. You will obtain a rectangle that encloses the curve. The
only problem with that method is that it is not guaranteed to give you
_the_ bounding box, which is usually defined the _smallest_ rectangle
that encloses the curve.
        For most applications, however, the control point method is good
enough. It is also much faster than obtaining a precise bounding box,
not to mention a lot easier to implement.

--
---------------------------------------------------------------
  Alexandre Sieira Vilar - http://www.tecgraf.puc-rio.br/~asv
 Computer Engineering Student at PUC-Rio - GNU and Linux rock!
     3rd kyu Aikikkai Aikidoka (as of November 28, 1998)
---------------------------------------------------------------
"To injure an opponent is to injure  yourself.   To  control
aggression without inflicting injury is the Art of Peace."

                                   Morihei Ueshiba

===========================================================================
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".

Reply via email to