From ff37a347d09864d959e87015b9bac37ce024cc24 Mon Sep 17 00:00:00 2001
From: Karishma Chadha <kchadha@scratch.mit.edu>
Date: Wed, 28 Feb 2018 16:34:35 -0500
Subject: [PATCH] Send flag to vm to indicate that mouse-up event was also the
 end of a drag. VM should use this flag to selectively activate the sprite
 click hat.

---
 src/containers/stage.jsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/containers/stage.jsx b/src/containers/stage.jsx
index 8687923e5..a56ae7330 100644
--- a/src/containers/stage.jsx
+++ b/src/containers/stage.jsx
@@ -186,9 +186,6 @@ class Stage extends React.Component {
             mouseDown: false,
             mouseDownPosition: null
         });
-        if (this.state.isDragging) {
-            this.onStopDrag();
-        }
         const data = {
             isDown: false,
             x: x - this.rect.left,
@@ -196,6 +193,10 @@ class Stage extends React.Component {
             canvasWidth: this.rect.width,
             canvasHeight: this.rect.height
         };
+        if (this.state.isDragging) {
+            this.onStopDrag();
+            data.wasDragged = true;
+        }
         this.props.vm.postIOData('mouse', data);
     }
     onMouseDown (e) {
-- 
GitLab