harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor V. Stolyarov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-5263) [classlib][awt] Graphics drawPolyline & drawPolygon methods work incorretly in XORMode
Date Thu, 06 Dec 2007 07:47:43 GMT
[classlib][awt] Graphics drawPolyline & drawPolygon methods work incorretly in XORMode
--------------------------------------------------------------------------------------

                 Key: HARMONY-5263
                 URL: https://issues.apache.org/jira/browse/HARMONY-5263
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: Linux
            Reporter: Igor V. Stolyarov


Graphics drawPolyline & drawPolygon methods work incorretly in XORMode

Simple reproducer:

import java.io.*; 
import java.awt.*; 
import java.awt.image.*; 
import javax.swing.*; 

public class DrawPolylineTest extends JFrame { 
   public static void main(String[] args){ 
      final DrawPolylineTest test = new DrawPolylineTest(); 
      test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
      test.setSize(200, 200); 
      test.add(new Panel(){
          public void paint(Graphics g){
              int w = getWidth();
              int h = getHeight();
              int num = 8;
              int x[] = new int[num];
              int y[] = new int[num];

              x[0] = w / 3;
              x[1] = w / 6;
              x[2] = w / 4;
              x[3] = (w / 5) * 2;
              x[4] = (w / 3) * 2;
              x[5] = (w / 5) * 3;
              x[6] = w - w / 6;
              x[7] = w / 2;

              y[0] = h - h / 5;
              y[1] = h - h / 3;
              y[2] = h / 6;
              y[3] = h / 3;
              y[4] = h / 4;
              y[5] = (h / 5) * 3;
              y[6] = h - h / 4;
              y[7] = h - h / 6;

              g.setColor(Color.green);
              g.fillRect(0, 0, w, h);
              g.setColor(Color.red);
              g.setXORMode(Color.blue);

              g.drawPolyline(x, y, num);
          }
      });
      test.setVisible(true);
   } 
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message