Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-5263

[classlib][awt] Graphics drawPolyline & drawPolygon methods work incorretly in XORMode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0M4
    • Classlib
    • None
    • Linux
    • Patch Available

    Description

      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);
      }
      }

      Attachments

        1. H-5263.patch
          2 kB
          Igor V. Stolyarov
        2. RI.PNG
          3 kB
          Igor V. Stolyarov
        3. Harmony.PNG
          3 kB
          Igor V. Stolyarov

        Activity

          People

            cap Alexey Petrenko
            ivstolyarov Igor V. Stolyarov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: