Fix Dragging bug

master
sigonasr2 4 years ago
parent a5b56026c8
commit 376b4bbcae
  1. BIN
      DivaBot/DivaBot.jar
  2. 2
      DivaBot/calibration_data.txt
  3. BIN
      DivaBot/capture_1.png
  4. BIN
      DivaBot/capture_2.png
  5. BIN
      DivaBot/capture_3.png
  6. 12
      DivaBot/src/sig/CustomRobot.java
  7. 2
      DivaBot/src/sig/Overlay.java

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…
Cancel
Save