diff options
Diffstat (limited to 'libjava/classpath/gnu/java/awt/java2d/QuadSegment.java')
-rw-r--r-- | libjava/classpath/gnu/java/awt/java2d/QuadSegment.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java b/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java index 9c15a8cfda0..5e15fe881d8 100644 --- a/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java +++ b/libjava/classpath/gnu/java/awt/java2d/QuadSegment.java @@ -88,8 +88,24 @@ public class QuadSegment extends Segment */ public Object clone() { - return new QuadSegment(P1.getX(), P1.getY(), cp.getX(), cp.getY(), - P2.getX(), P2.getY()); + QuadSegment segment = null; + + try + { + segment = (QuadSegment) super.clone(); + + segment.P1 = (Point2D) P1.clone(); + segment.P2 = (Point2D) P2.clone(); + segment.cp = (Point2D) cp.clone(); + } + catch (CloneNotSupportedException cnse) + { + InternalError ie = new InternalError(); + ie.initCause(cnse); + throw ie; + } + + return segment; } /** @@ -201,12 +217,12 @@ public class QuadSegment extends Segment P2 = p; } - public double[] first() + public double[] cp1() { return new double[]{cp.getX(), cp.getY()}; } - public double[] last() + public double[] cp2() { return new double[]{cp.getX(), cp.getY()}; } |