Fix Dragging bug
This commit is contained in:
parent
a5b56026c8
commit
376b4bbcae
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
437
|
||||
438
|
||||
288
|
||||
1330
|
||||
793
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 883 KiB After Width: | Height: | Size: 684 KiB |
Binary file not shown.
Before Width: | Height: | Size: 233 KiB After Width: | Height: | Size: 681 KiB |
Binary file not shown.
Before Width: | Height: | Size: 880 KiB After Width: | Height: | Size: 681 KiB |
@ -21,23 +21,23 @@ public class CustomRobot extends Robot{
|
||||
BufferedImage scoreCurrentScreen;
|
||||
int[] calibration_data = new int[]{0,0,1,1};
|
||||
long lastCalibrationTime = 0;
|
||||
GraphicsEnvironment ge;
|
||||
GraphicsDevice[] gs;
|
||||
public static GraphicsEnvironment ge;
|
||||
public static GraphicsDevice[] gs;
|
||||
|
||||
public CustomRobot() throws AWTException {
|
||||
super();
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice[] gs = ge.getScreenDevices();
|
||||
this.ge=ge;
|
||||
this.gs=gs;
|
||||
CustomRobot.ge=ge;
|
||||
CustomRobot.gs=gs;
|
||||
}
|
||||
|
||||
public CustomRobot(GraphicsDevice screen) throws AWTException {
|
||||
super(screen);
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice[] gs = ge.getScreenDevices();
|
||||
this.ge=ge;
|
||||
this.gs=gs;
|
||||
CustomRobot.ge=ge;
|
||||
CustomRobot.gs=gs;
|
||||
}
|
||||
|
||||
public synchronized BufferedImage getSizedCapture(Rectangle r) {
|
||||
|
@ -179,7 +179,7 @@ public class Overlay extends JPanel implements MouseMotionListener,MouseListener
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
if (started) {
|
||||
MyRobot.ENDDRAG=e.getLocationOnScreen();
|
||||
MyRobot.ENDDRAG=e.getPoint();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user