From 1781c45317b0dcec8bb1ebbd0a833daf3f93e22a Mon Sep 17 00:00:00 2001 From: bancika Date: Sun, 16 Jan 2011 08:38:10 +0000 Subject: [PATCH] outline optimization --- .../DIYLC/src/org/diylc/presenter/G2DWrapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/G2DWrapper.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/G2DWrapper.java index 5824d602..e7123a58 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/G2DWrapper.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/G2DWrapper.java @@ -62,7 +62,7 @@ class G2DWrapper extends Graphics2D { private Font originalFont; private AffineTransform currentTx; private Area currentArea; - private Shape lastFilledShape; + private Shape lastShape; /** * Creates a wrapper around specified {@link Graphics2D} object. @@ -88,7 +88,7 @@ class G2DWrapper extends Graphics2D { originalComposite = canvasGraphics.getComposite(); originalFont = canvasGraphics.getFont(); currentTx = new AffineTransform(); - lastFilledShape = null; + lastShape = null; } /** @@ -119,7 +119,7 @@ class G2DWrapper extends Graphics2D { Area area = new Area(s); area.transform(currentTx); currentArea.add(area); - lastFilledShape = s; + lastShape = s; } /** @@ -129,9 +129,10 @@ class G2DWrapper extends Graphics2D { */ private void appendShapeOutline(Shape s) { // Do not add shape outline if the same shape has been filled recently. - if (!drawingComponent || s.equals(lastFilledShape)) { + if (!drawingComponent || s.equals(lastShape)) { return; } + lastShape = s; PathIterator pathIterator = s.getPathIterator(null); double thickness; if (getStroke() instanceof BasicStroke) {