mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-24 04:42:51 -04:00
shows x/y pos in generic circuits, closes #676
This commit is contained in:
parent
769da5b07f
commit
5bbbade616
@ -1524,6 +1524,8 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
|
|||||||
private class MouseDispatcher extends MouseAdapter implements MouseMotionListener {
|
private class MouseDispatcher extends MouseAdapter implements MouseMotionListener {
|
||||||
private Vector pos;
|
private Vector pos;
|
||||||
private boolean isMoved;
|
private boolean isMoved;
|
||||||
|
private int statusX;
|
||||||
|
private int statusY;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
@ -1555,6 +1557,18 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
|
|||||||
toolTipHighlighted = false;
|
toolTipHighlighted = false;
|
||||||
}
|
}
|
||||||
lastMousePos = new Vector(e.getX(), e.getY());
|
lastMousePos = new Vector(e.getX(), e.getY());
|
||||||
|
|
||||||
|
if (getCircuit().getAttributes().get(Keys.IS_GENERIC)) {
|
||||||
|
Vector p = getPosVector(e);
|
||||||
|
int x = Math.round(p.getXFloat() / SIZE);
|
||||||
|
int y = Math.round(p.getYFloat() / SIZE);
|
||||||
|
if (x != statusX || y != statusY) {
|
||||||
|
getMain().setStatus("pos: " + x + ", " + y);
|
||||||
|
statusX = x;
|
||||||
|
statusY = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
activeMouseController.moved(e);
|
activeMouseController.moved(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user