/** * Should perform the equivilent action as * createRendering followed by drawing the RenderedImage to * Graphics2D, or return false. * * @param g2d The Graphics2D to draw to. * @return true if the paint call succeeded, false if * for some reason the paint failed (in which * case a createRendering should be used). */ public boolean paintRable(Graphics2D g2d) { // This optimization only apply if we are using // SrcOver. Otherwise things break... Composite c = g2d.getComposite(); if (!SVGComposite.OVER.equals(c)) return false; if (getPadMode() != PadMode.ZERO_PAD) return false; Rectangle2D padBounds = getPadRect(); Shape clip = g2d.getClip(); g2d.clip(padBounds); GraphicsUtil.drawImage(g2d, getSource()); g2d.setClip(clip); return true; }
/** * Should perform the equivilent action as * createRendering followed by drawing the RenderedImage to * Graphics2D, or return false. * * @param g2d The Graphics2D to draw to. * @return true if the paint call succeeded, false if * for some reason the paint failed (in which * case a createRendering should be used). */ public boolean paintRable(Graphics2D g2d) { // This optimization only apply if we are using // SrcOver. Otherwise things break... Composite c = g2d.getComposite(); if (!SVGComposite.OVER.equals(c)) return false; if (getPadMode() != PadMode.ZERO_PAD) return false; Rectangle2D padBounds = getPadRect(); Shape clip = g2d.getClip(); g2d.clip(padBounds); GraphicsUtil.drawImage(g2d, getSource()); g2d.setClip(clip); return true; }
/** * Should perform the equivilent action as * createRendering followed by drawing the RenderedImage to * Graphics2D, or return false. * * @param g2d The Graphics2D to draw to. * @return true if the paint call succeeded, false if * for some reason the paint failed (in which * case a createRendering should be used). */ public boolean paintRable(Graphics2D g2d) { // This optimization only apply if we are using // SrcOver. Otherwise things break... Composite c = g2d.getComposite(); if (!SVGComposite.OVER.equals(c)) return false; if (getPadMode() != PadMode.ZERO_PAD) return false; Rectangle2D padBounds = getPadRect(); Shape clip = g2d.getClip(); g2d.clip(padBounds); GraphicsUtil.drawImage(g2d, getSource()); g2d.setClip(clip); return true; }