mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 22:41:59 -04:00
fixed highlight issue if elements are pasted
This commit is contained in:
parent
bfc094dc27
commit
8aa4270f94
@ -136,6 +136,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
|
|||||||
Vector posVector = getPosVector(lastMousePos.x, lastMousePos.y);
|
Vector posVector = getPosVector(lastMousePos.x, lastMousePos.y);
|
||||||
ArrayList<Moveable> elements = CircuitTransferable.createList(data, shapeFactory, posVector);
|
ArrayList<Moveable> elements = CircuitTransferable.createList(data, shapeFactory, posVector);
|
||||||
if (elements != null) {
|
if (elements != null) {
|
||||||
|
removeHighLighted();
|
||||||
mouseInsertList.activate(elements, posVector);
|
mouseInsertList.activate(elements, posVector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1261,7 +1262,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void clicked(MouseEvent e) {
|
void clicked(MouseEvent e) {
|
||||||
if (elements != null) {
|
if (elements != null && e.getButton() == 1) {
|
||||||
for (Moveable m : elements) {
|
for (Moveable m : elements) {
|
||||||
if (m instanceof Wire)
|
if (m instanceof Wire)
|
||||||
circuit.add((Wire) m);
|
circuit.add((Wire) m);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user