Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4469881

Dotted rectangle is drawn biased by 1x1 dot from the correct position.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Resolved In Build:
      beta2
    • CPU:
      x86
    • OS:
      windows_2000

      Description


      ingrid.yao@Eng 2001-06-14

      J2SE Version (please include all output from java -version flag):

      1.4.0-beta_refresh-b66


      Does this problem occur on J2SE 1.3? Yes / No (pick one)

      No.


      Operating System Configuration Information (be specific):

      Windows 2000 (can be reproduced on Solaris/Sparc)


      Hardware Configuration Information (be specific):

      Pentium III 650MHz / 256MB RAM / Rage 128 (with 8MB VRAM)


      Bug Description:

      Dotted rectangle is drawn biased by 1x1 dot from the correct position.



      Steps to Reproduce (be specific):

      Try the following program. It sets clip region and draws rectangles.
      Just solid box is drawn ok. But dotted box is drawn somewhat odd.
      It seems that the rectangle itself is moved in left upper direction
      by 1x1 dot. I've tested a few case. But it seems that it's related
      to dotted stroke. Other factors are not affecting drawing of boxes.

      import java.awt.*;

      public class Test extends Frame {

          private static final Stroke OUTLINE
              = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER,
                                10.0f, new float[] {2.5f, 3.5f}, 0.0f);

          public static void main(String[] argv) {
              Test t = new Test();
              t.setBounds(100, 100, 500, 500);
              t.show();
          }

          public void paint(Graphics g) {
              Graphics2D g2d = (Graphics2D) g;

              /* Normal solid line. */
              g.setClip(100, 100, 100, 100);
              g.drawRect(100, 100, 99, 99);

              /* Dotted line. */
              g.setClip(300, 100, 100, 100);
              g2d.setStroke(OUTLINE);
              g.drawRect(300, 100, 99, 99);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                flar Jim Graham
                Reporter:
                tyao Ting-Yun Ingrid Yao (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: