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

Drawing polyline twice in XOR mode leaves out some traces on screen (only with uiScale=1.0)

XMLWordPrintable

    • 2d
    • x86_64
    • os_x

      While using Metal rendering pipeline, it is observed that drawing polyline twice in XOR mode leaves out some traces (only with uiScale=1.0 or on external monitor).

      Expected :
      Drawing something twice in XOR Mode should clear off the drawing.

      Tested with this code -

           protected void paintComponent(Graphics g) {
                  super.paintComponent(g);
                  Graphics2D g2d = (Graphics2D) g;

                  g2d.setBackground(Color.BLUE);
                  g2d.clearRect(0, 0, 500, 500);

                  int min = 10;
                  int max = 210;
                  int mid = 110;

                  int xdp[] = {min, max, min, max, min, max};
                  int ydp[] = {min, min, mid, max, max, mid};

                  g2d.setXORMode(Color.GREEN);
                  g2d.drawPolygon(xdp, ydp, xdp.length);
                  g2d.drawPolygon(xdp, ydp, xdp.length);
          }

            aghaisas Ajit Ghaisas
            aghaisas Ajit Ghaisas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: