fixed highlight issue if elements are pasted

This commit is contained in:
hneemann 2017-04-01 16:01:29 +02:00
parent bfc094dc27
commit 8aa4270f94

View File

@ -136,6 +136,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
Vector posVector = getPosVector(lastMousePos.x, lastMousePos.y);
ArrayList<Moveable> elements = CircuitTransferable.createList(data, shapeFactory, posVector);
if (elements != null) {
removeHighLighted();
mouseInsertList.activate(elements, posVector);
}
}
@ -1261,7 +1262,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
@Override
void clicked(MouseEvent e) {
if (elements != null) {
if (elements != null && e.getButton() == 1) {
for (Moveable m : elements) {
if (m instanceof Wire)
circuit.add((Wire) m);