bounds of line2d

Discussion in 'Java' started by Thorsten Kiefer, Jul 31, 2008.

  1. Hi,
    the following code
    System.err.println(new Line2D.Double(0,0,20,20).getBounds2D());
    System.err.println(new Area(new Line2D.Double(0,0,20,20)).getBounds2D());

    produces the following output :
    java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=20.0,h=20.0]
    java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=0.0,h=0.0]

    Is there a way to make the area object have the same boundaries
    as the line object ?

    Best Regards
    Thorsten
    Thorsten Kiefer, Jul 31, 2008
    #1
    1. Advertising

  2. Thorsten Kiefer wrote:

    > Hi,
    > the following code
    > System.err.println(new Line2D.Double(0,0,20,20).getBounds2D());
    > System.err.println(new Area(new
    > Line2D.Double(0,0,20,20)).getBounds2D());
    >
    > produces the following output :
    > java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=20.0,h=20.0]
    > java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=0.0,h=0.0]
    >
    > Is there a way to make the area object have the same boundaries
    > as the line object ?
    >
    > Best Regards
    > Thorsten


    is it a bug or a feature ?
    Thorsten Kiefer, Jul 31, 2008
    #2
    1. Advertising

  3. Thorsten Kiefer

    Jeff Higgins Guest

    Thorsten Kiefer wrote:
    > Hi,
    > the following code
    > System.err.println(new Line2D.Double(0,0,20,20).getBounds2D());
    > System.err.println(new Area(new Line2D.Double(0,0,20,20)).getBounds2D());
    >
    > produces the following output :
    > java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=20.0,h=20.0]
    > java.awt.geom.Rectangle2D$Double[x=0.0,y=0.0,w=0.0,h=0.0]
    >
    > Is there a way to make the area object have the same boundaries
    > as the line object ?
    >
    > Best Regards
    > Thorsten
    >

    from the javadocs - "Only closed paths and sub-paths are stored".
    Jeff Higgins, Jul 31, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZHdlbndhQGNvbXBhbnlhYmMuY29t?=

    Re: Index Out of Bounds Error

    =?Utf-8?B?ZHdlbndhQGNvbXBhbnlhYmMuY29t?=, Oct 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    =?Utf-8?B?ZHdlbndhQGNvbXBhbnlhYmMuY29t?=
    Oct 20, 2004
  2. Replies:
    0
    Views:
    3,153
  3. Rick
    Replies:
    2
    Views:
    589
    Andrew Hobbs
    Oct 12, 2003
  4. joe pribele

    strange behaviour Line2D

    joe pribele, Apr 8, 2004, in forum: Java
    Replies:
    1
    Views:
    330
    David Vivash
    Apr 8, 2004
  5. Rod Nibbe
    Replies:
    2
    Views:
    4,023
    Rod Nibbe
    Aug 11, 2004
Loading...

Share This Page