Graphics.fillPolygon(...) depends on it's position on the screen

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P4
    • 5.0-pool
    • Affects Version/s: 5.0
    • Component/s: client-libs
    • None
    • 2d
    • sparc
    • solaris_8



      Name: spR10137 Date: 10/14/2003



      Compile and run simple application. Try to change frame's position
      on the screen. Notice, that polygon behaviour depends on it's
      position. It looks defferent in left and right parts of the screen.

      -------------------- ScreenPos.java --------------------
      import java.awt.*;
      import java.awt.event.*;

      public class ScreenPos extends Frame implements ComponentListener {

          int[] xpts = {0x0a, 0x0a, 0x7e00, 0x3c};
          int[] ypts = {0x0a, 0x14, 0x32, 0x5a};
          Canvas c;
          public ScreenPos() {
              super("Fill GP Test");

              c = new Canvas() {
                  public void paint(Graphics g) {
                      g.setColor(Color.black);
                      g.fillPolygon(xpts, ypts, 4);
                  }
              };
              c.setSize(100, 300);
              c.setBackground(Color.white);
              add(c);
              addComponentListener(this);
          }

          public static void main(String[] args) {
              ScreenPos sp = new ScreenPos();
              sp.pack();
              sp.show();
          }

          public void componentHidden(ComponentEvent e) {
          }

          public void componentMoved(ComponentEvent e) {
              c.repaint();
          }

          public void componentResized(ComponentEvent e) {
              c.repaint();
          }

          public void componentShown(ComponentEvent e) {
              c.repaint();
          }
      }
      -------------------- end of file --------------------

      ======================================================================

            Assignee:
            Alexey Ushakov
            Reporter:
            Sergei Pikalev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: