From e35e29bd31ad9d5a5eb15ca4aa8acbf3367dd388 Mon Sep 17 00:00:00 2001 From: LDDestroier Date: Tue, 16 Apr 2019 17:56:42 -0400 Subject: [PATCH] Fixed line tool --- pain2.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pain2.lua b/pain2.lua index 103bb66..b364b34 100644 --- a/pain2.lua +++ b/pain2.lua @@ -1458,7 +1458,7 @@ local getInput = function() if adjX >= 1 and adjX <= pain.size.width and adjY >= 1 and adjY <= pain.size.height then pain.isInFocus = true - + if adjY == pain.size.height then if evt[1] == "mouse_click" then @@ -1473,7 +1473,11 @@ local getInput = function() else if pain.limitOneMouseButton then - dragPoses = {{{},{}}, {{},{}}, {{},{}}} + dragPoses = { + dragPoses[1] or {{},{}}, + dragPoses[2] or {{},{}}, + dragPoses[3] or {{},{}} + } dragPoses = { [evt[2]] = { { @@ -1530,7 +1534,11 @@ local getInput = function() keysDown = {} end elseif evt[1] == "mouse_up" then - dragPoses[evt[2]] = {{},{}}, {{},{}}, {{},{}} + if pain.limitOneMouseButton then + dragPoses = {{{},{}}, {{},{}}, {{},{}}} + else + dragPoses[evt[2]] = {{},{}}, {{},{}}, {{},{}} + end miceDown[evt[2]] = false elseif evt[1] == "key_up" then keysDown[evt[2]] = false