Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-871

setOpaque(false) not honoured

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Incomplete
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: GVT
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      JSVGCanvas and JSVGComponent ignore setOpaque() and always draw a background

      I think it's becuase
      AbstractJGVTComponent.paintComponent
      always does this...

      g2d.setComposite(AlphaComposite.SrcOver);
      g2d.setPaint(getBackground());
      g2d.fillRect(visRect.x, visRect.y,
      visRect.width, visRect.height);

      but perhaps this should be wrapped in a isOpaque check?

      if{isOpqaue())
      {
      g2d.setComposite(AlphaComposite.SrcOver);
      g2d.setPaint(getBackground());
      g2d.fillRect(visRect.x, visRect.y,
      visRect.width, visRect.height);
      }

      current workaround (which maybe processor heavy) is to set the component background to a color with a alpha channel set to 0 (e.g. setBackground(new Color(0,0,0,0));

        Attachments

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              java@dialsolutions.co.uk James D
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: