From 26f22c172bcca1de90e74e1f42f35a77165fa39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=84=B8=EC=A0=A4=EA=B7=80=20=EA=B3=A0=EC=96=91=EC=9D=B4?= =?UTF-8?q?=EB=93=A4?= <46598063+qwreey75@users.noreply.github.com> Date: Mon, 21 Feb 2022 21:28:58 +0900 Subject: [PATCH] Changed mouse tracking for none running env --- exemple/elasticScrollFrame.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exemple/elasticScrollFrame.lua b/exemple/elasticScrollFrame.lua index b56b44c..0192556 100644 --- a/exemple/elasticScrollFrame.lua +++ b/exemple/elasticScrollFrame.lua @@ -1,5 +1,7 @@ local Quad = require(game.ReplicatedStorage:WaitForChild "Quad"); ---@module "Quad.src" local _ = Quad.init "components"; local round,class,mount,store,event,tween = _.round,_.class,_.mount,_.store,_.event,_.tween; +local RunService = game:GetService"RunService"; +local IsRunning = RunService:IsRunning(); local max = math.max; local min = math.min; local abs = math.abs; @@ -146,7 +148,7 @@ function scrollFrame:render(props) if inputType == mouseButton1 or inputType == touch then local position = input.Position; local x = position.X; - local y = position.Y + 36; + local y = position.Y + (IsRunning and 36 or 0); self:update(self._targetX + ((x - upX) * mouseUpMut),self._targetY + ((- y + upY)*mouseUpMut)); mouseConnection:disconnect(); self:fit(); @@ -155,7 +157,7 @@ function scrollFrame:render(props) mouseConnection:add(inputChanged:Connect(function (input) if input.UserInputType == mouseMovement then local position = input.Position; - local x,y = position.X,position.Y + 36; + local x,y = position.X,position.Y + (IsRunning and 36 or 0); self:update(lastX + (downX - x),lastY + (downY - y)); upX,upY = x,y;