From 7fd817191b7af770ad467ffcae589a0f52eb3ac1 Mon Sep 17 00:00:00 2001 From: bancika Date: Sat, 15 Jan 2011 21:52:53 +0000 Subject: [PATCH] optimize selection rect --- .../DIYLC/src/org/diylc/presenter/Presenter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java index ea35dc11..d35953e5 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java @@ -732,8 +732,9 @@ public class Presenter implements IPlugInPort { } else if (selectedComponents.isEmpty()) { // If there's no selection, the only thing to do is update the // selection rectangle and refresh. + Rectangle oldSelectionRect = selectionRect == null ? null : new Rectangle(selectionRect); this.selectionRect = Utils.createRectangle(scaledPoint, previousDragPoint); - repaint = true; + repaint = !selectionRect.equals(oldSelectionRect); // messageDispatcher.dispatchMessage(EventType.SELECTION_RECT_CHANGED, // selectionRect); }