Skip to content

Commit

Permalink
Add TODO to drag when not selecting anything
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimatePea committed Feb 22, 2017
1 parent 7c26f77 commit 2c31ed7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/painttools/tools/SelectTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ public void mouseExited(MouseEvent e) {
@Override
public void mouseDragged(MouseEvent e) {

//do nothing if dragged empty
if(!canDrag) return;
// if it is the first time in our move, and only one selected before the
// start of dragging, i.e. two items selected after mouse press
if (!moved && !movingComponentOriginallySelected) {
if (selectedComponents.size() == 2) {
//deselect the bottom component
// do nothing if dragged empty
// TODO GROUP SELECTION WHEN CANNOT DRAG
if (!canDrag)
return;
// if it is the first time in our move, and the moving component is not
// originally selected, deselect all bottom components
if (!moved && !movingComponentOriginallySelected) {
// deselect the bottom components, by removing all until
while (selectedComponents.size() != 1) {
deselectComponent(selectedComponents.get(0));
}
}
Expand Down Expand Up @@ -203,7 +205,7 @@ public void mouseDragged(MouseEvent e) {

@Override
public void mouseMoved(MouseEvent e) {

// shows a left arrow if cursor hits something
PaintComponent comp = panel.componentUnderPoint(e.getX(), e.getY());
if (comp != null) {
Expand Down

0 comments on commit 2c31ed7

Please sign in to comment.