Fix Dragging bug

This commit is contained in:
sigonasr2 2020-09-21 09:04:27 +09:00
parent a5b56026c8
commit 376b4bbcae
7 changed files with 8 additions and 8 deletions

Binary file not shown.

View File

@ -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

View File

@ -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) {

View File

@ -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();
}
}