From 9981856413f2da4b178fc9d30b611a4a731623db Mon Sep 17 00:00:00 2001 From: Brian Reynolds Date: Sat, 18 Jul 2020 20:14:14 -0400 Subject: [PATCH 1/2] 13196 Well that one was easy, all deletions --- .../VASSAL/build/module/map/KeyBufferer.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/main/java/VASSAL/build/module/map/KeyBufferer.java b/src/main/java/VASSAL/build/module/map/KeyBufferer.java index c7b0a8a5a4..52d2141644 100644 --- a/src/main/java/VASSAL/build/module/map/KeyBufferer.java +++ b/src/main/java/VASSAL/build/module/map/KeyBufferer.java @@ -128,20 +128,17 @@ public void mousePressed(MouseEvent e) { } // RFE 1629255 - If the top piece of an unexpanded stack is left-clicked // while not selected, then select all of the pieces in the stack - // RFE 1659481 - Control clicking only deselects - if (!SwingUtils.isControlDown(e)) { - if (movingStacksPickupUnits || - p.getParent() == null || - p.getParent().isExpanded() || - SwingUtils.isRightMouseButton(e) || - Boolean.TRUE.equals(p.getProperty(Properties.SELECTED))) - { - kbuf.add(p); - } - else { - Stack s = p.getParent(); - s.asList().forEach(gamePiece -> KeyBuffer.getBuffer().add(gamePiece)); - } + if (movingStacksPickupUnits || + p.getParent() == null || + p.getParent().isExpanded() || + SwingUtils.isRightMouseButton(e) || + Boolean.TRUE.equals(p.getProperty(Properties.SELECTED))) + { + kbuf.add(p); + } + else { + Stack s = p.getParent(); + s.asList().forEach(gamePiece -> KeyBuffer.getBuffer().add(gamePiece)); } // End RFE 1629255 } From cb5b54421d23f58dff9f9d893c96c9cb7b64435e Mon Sep 17 00:00:00 2001 From: Brian Reynolds Date: Mon, 20 Jul 2020 20:41:17 -0400 Subject: [PATCH 2/2] 13196 toggle inside an expanded stack - was missing else case --- src/main/java/VASSAL/build/module/map/KeyBufferer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/VASSAL/build/module/map/KeyBufferer.java b/src/main/java/VASSAL/build/module/map/KeyBufferer.java index 52d2141644..b91904ce98 100644 --- a/src/main/java/VASSAL/build/module/map/KeyBufferer.java +++ b/src/main/java/VASSAL/build/module/map/KeyBufferer.java @@ -151,6 +151,9 @@ public void mousePressed(MouseEvent e) { } else if (!s.isExpanded()) { s.asList().forEach(gamePiece -> KeyBuffer.getBuffer().remove(gamePiece)); + } + else { + kbuf.remove(p); } } // End RFE 1659481