From 2d9f260b1e1ea6c501785241b71a17e793cd826c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 7 Mar 2014 23:11:59 +0100 Subject: [PATCH] * Changed mouse wheel handling for card enlargement. --- .../plugins/adapters/MageActionCallback.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java index 5a8512126f..69e8be9d08 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java +++ b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java @@ -45,6 +45,12 @@ import org.apache.log4j.Logger; import org.jdesktop.swingx.JXPanel; import org.mage.plugins.card.images.ImageCache; +/** + * Class that handles the callbacks from the card panels to mage to display big card + * images from the cards the mouse hovers on. Also handles tooltip text window. + * + * @author Nantuko + */ public class MageActionCallback implements ActionCallback { private static final Logger logger = Logger.getLogger(ActionCallback.class); @@ -349,16 +355,23 @@ public class MageActionCallback implements ActionCallback { @Override public void mouseWheelMoved(MouseWheelEvent e, TransferData transferData) { - if (enlargedImageWindowOpen) { - hideEnlargedCard(); - return; - } int notches = e.getWheelRotation(); + if (enlargedImageWindowOpen) { + // same move direction will be ignored, opposite direction closes the enlarged window + if (enlargeMode.equals(EnlargeMode.NORMAL)) { + if (notches > 0) { + hideEnlargedCard(); + } + } else { + if (notches < 0) { + hideEnlargedCard(); + } + } + return; + } if (notches < 0) { // move up - show normal image - enlargeCard(EnlargeMode.NORMAL); - } else { // move down - show alternate image enlargeCard(EnlargeMode.ALTERNATE);