src/share/classes/javax/swing/JViewport.java

Print this page

        

*** 1584,1597 **** // clip* are in the views coordinate space. RepaintManager rm = RepaintManager.currentManager(this); int bdx = blitToX - blitFromX; int bdy = blitToY - blitFromY; // Shift the scrolled region rm.copyArea(this, g, blitFromX, blitFromY, blitW, blitH, bdx, bdy, false); ! // Paint the newly exposed region. int x = view.getX(); int y = view.getY(); g.translate(x, y); g.setClip(clipX, clipY, clipW, clipH); --- 1584,1605 ---- // clip* are in the views coordinate space. RepaintManager rm = RepaintManager.currentManager(this); int bdx = blitToX - blitFromX; int bdy = blitToY - blitFromY; + Composite oldComposite = null; // Shift the scrolled region + if (g instanceof Graphics2D) { + Graphics2D g2d = (Graphics2D) g; + oldComposite = g2d.getComposite(); + g2d.setComposite(AlphaComposite.Src); + } rm.copyArea(this, g, blitFromX, blitFromY, blitW, blitH, bdx, bdy, false); ! if (oldComposite != null) { ! ((Graphics2D) g).setComposite(oldComposite); ! } // Paint the newly exposed region. int x = view.getX(); int y = view.getY(); g.translate(x, y); g.setClip(clipX, clipY, clipW, clipH);