-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
generic
-
generic
Name: gsC80088 Date: 11/28/98
// drawArc() incorrect in 1.2RC2 when
// drawn onto off-screen Image
//
import java.applet.*;
import java.awt.*;
public class ArcBug extends Applet {
public static void main(String args[]) {
ArcBug arcBug = new ArcBug();
Frame frame = new Frame("Arc bug");
frame.add("Center", arcBug);
frame.setSize(200, 120);
frame.show();
}
public void paint(Graphics g) {
int width = getSize().width,
height = getSize().height;
Graphics offscreenGraphics;
Image offscreenImage;
// Create the off-screen drawable
//
offscreenImage = createImage(width, height);
offscreenGraphics = offscreenImage.getGraphics();
// Draw the arc off-screen (incorrectly drawn)
//
offscreenGraphics.setColor(Color.white);
offscreenGraphics.fillRect(0, 0, width, height);
offscreenGraphics.setColor(Color.blue);
offscreenGraphics.drawString("Incorrect arc", 10, 30);
offscreenGraphics.drawArc(35, 50, 20, 20, 0, 180);
// And copy it onto the screen
//
g.drawImage(offscreenImage, 0, 0, this);
// Now, draw the arc on-screen (correctly drawn)
//
g.setColor(Color.black);
g.drawString("Correct arc", 110, 30);
g.drawArc(125, 50, 20, 20, 0, 180);
}
}
(Review ID: 43406)
======================================================================
- duplicates
-
JDK-4151279 Curves are not as pleasing as JDK 1.1 (affects ovals, arcs and roundrects)
-
- Resolved
-
- relates to
-
JDK-4179437 drawOval to offscreen image results in lumpy circles
-
- Closed
-