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

[classlib][awt] Graphics.drawOval incorrectly works with AlphaComposite different from AlphaComposite.SrcOver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0M4
    • Classlib
    • None
    • Win
    • Patch Available

    Description

      Graphics.drawOval incorrectly works with AlphaComposite different from AlphaComposite.SrcOver

      Simple reproducer:
      import java.io.*;
      import java.awt.*;
      import java.awt.image.*;
      import javax.swing.*;

      public class DrawOvalTest extends JFrame {
      public static void main(String[] args){
      final DrawOvalTest test = new DrawOvalTest();
      test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      test.setSize(200, 200);
      test.add(new Panel(){
      public void paint(Graphics g)

      { Composite composite = AlphaComposite.Clear; int w = test.getWidth(); int h = test.getHeight(); g.setColor(Color.green); g.fillRect(0, 0, w, h); Graphics2D g2d = (Graphics2D)g; g2d.setColor(Color.red); g2d.setComposite(composite); g2d.drawOval(w/4, h/4, w/2, h/2); }

      });
      test.setVisible(true);
      }
      }

      Attachments

        1. H-5240.patch
          0.7 kB
          Igor V. Stolyarov
        2. Harmony.JPG
          5 kB
          Igor V. Stolyarov
        3. RI.JPG
          5 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: