From 68f7bf4dfea81c935360427da1748483218da9d2 Mon Sep 17 00:00:00 2001 From: Doublestrike Date: Thu, 16 Feb 2012 04:44:21 +0000 Subject: [PATCH] Experimental clipping on FPanel. --- src/main/java/forge/view/toolbox/FPanel.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/forge/view/toolbox/FPanel.java b/src/main/java/forge/view/toolbox/FPanel.java index 7dfa7465029..baf102fc413 100644 --- a/src/main/java/forge/view/toolbox/FPanel.java +++ b/src/main/java/forge/view/toolbox/FPanel.java @@ -190,17 +190,24 @@ public class FPanel extends JPanel { */ @Override public void paintComponent(final Graphics graphics0) { - super.paintComponent(graphics0); + //super.paintComponent(graphics0); pnlW = this.getWidth(); pnlH = this.getHeight(); final Graphics2D g2d = (Graphics2D) graphics0.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - drawBackgroundColor(g2d); + if (this.backgroundTexture == null) { + drawBackgroundColor(g2d); + } + else { + drawBackgroundTexture(g2d); + } - /*// Draw background as required - if (foregroundStretch && foregroundImage != null) { + super.paintComponent(g2d); + + // Draw background as required + /* if (foregroundStretch && foregroundImage != null) { drawForegroundStretched(g2d); } else if (this.backgroundTexture == null) {