Commit f5e06601 authored by Leigh B. Stoller's avatar Leigh B. Stoller

A couple of changes:

* Allow nodes that currently moving to be dragged to an alternate
  location (thereby interrupting current motion, and giving it a new one).

* Fix some check collision problems.
parent cb7649c6
......@@ -596,6 +596,9 @@ public class RoboTrack extends JApplet {
public boolean CheckOutOfBounds() {
Enumeration robot_enum = robots.elements();
if (Cameras.size() == 0)
return false;
while (robot_enum.hasMoreElements()) {
Robot robbie = (Robot)robot_enum.nextElement();
int index;
......@@ -687,14 +690,14 @@ public class RoboTrack extends JApplet {
if (Math.abs(robbie.z - mary.z) > 0.25)
continue;
if (mary.gotdest) {
ox1 = ox2 = mary.dx;
oy1 = oy2 = mary.dy;
}
else if (mary.dragging) {
if (mary.dragging) {
ox1 = ox2 = mary.drag_x;
oy1 = oy2 = mary.drag_y;
}
else if (mary.gotdest) {
ox1 = ox2 = mary.dx;
oy1 = oy2 = mary.dy;
}
else {
ox1 = ox2 = mary.x;
oy1 = oy2 = mary.y;
......@@ -866,7 +869,7 @@ public class RoboTrack extends JApplet {
g2.setColor(Color.gray);
g2.drawLine(x, y, dx, dy);
}
else if (robbie.dragging) {
if (robbie.dragging) {
int dx = robbie.drag_x;
int dy = robbie.drag_y;
......@@ -1179,15 +1182,6 @@ public class RoboTrack extends JApplet {
return;
}
/*
* Do not allow robots with current destinations
* to be dragged. Not yet, maybe later.
*/
if (robbie.gotdest) {
node_id = null;
return;
}
robbie.drag_x = e.getX();
robbie.drag_y = e.getY();
......@@ -1373,7 +1367,6 @@ public class RoboTrack extends JApplet {
public void mouseMoved(MouseEvent e) {
}
/*
* Show left popup.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment