Skip to content

Commit 616a43e

Browse files
committed
Mousepad fix
1 parent 099f01d commit 616a43e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Source/GUIObjects.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,8 @@ void MousePad::mouseDown(const MouseEvent& e)
11891189
sys_lock();
11901190
outlet_anything(x->x_obj.ob_outlet, gensym("click"), 1, at);
11911191
sys_unlock();
1192+
1193+
isPressed = true;
11921194

11931195
// glist_grab(x->x_glist, &x->x_obj.te_g, (t_glistmotionfn)pad_motion, 0, (float)xpix, (float)ypix);
11941196
}
@@ -1221,7 +1223,7 @@ void MousePad::mouseMove(const MouseEvent& e)
12211223

12221224
void MousePad::mouseUp(const MouseEvent& e)
12231225
{
1224-
if (!getScreenBounds().contains(e.getScreenPosition())) return;
1226+
if (!getScreenBounds().contains(e.getScreenPosition()) && !isPressed) return;
12251227

12261228
auto* x = static_cast<t_pad*>(gui.getPointer());
12271229
t_atom at[1];

Source/GUIObjects.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ struct MousePad : public GUIComponent
858858
{
859859

860860
bool isLocked = false;
861+
bool isPressed = false;
861862

862863
typedef struct _pad
863864
{

0 commit comments

Comments
 (0)