Changed mouse tracking for none running env
This commit is contained in:
parent
341e9d5d7b
commit
26f22c172b
1 changed files with 4 additions and 2 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
local Quad = require(game.ReplicatedStorage:WaitForChild "Quad"); ---@module "Quad.src"
|
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 _ = 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 max = math.max;
|
||||||
local min = math.min;
|
local min = math.min;
|
||||||
local abs = math.abs;
|
local abs = math.abs;
|
||||||
|
|
@ -146,7 +148,7 @@ function scrollFrame:render(props)
|
||||||
if inputType == mouseButton1 or inputType == touch then
|
if inputType == mouseButton1 or inputType == touch then
|
||||||
local position = input.Position;
|
local position = input.Position;
|
||||||
local x = position.X;
|
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));
|
self:update(self._targetX + ((x - upX) * mouseUpMut),self._targetY + ((- y + upY)*mouseUpMut));
|
||||||
mouseConnection:disconnect();
|
mouseConnection:disconnect();
|
||||||
self:fit();
|
self:fit();
|
||||||
|
|
@ -155,7 +157,7 @@ function scrollFrame:render(props)
|
||||||
mouseConnection:add(inputChanged:Connect(function (input)
|
mouseConnection:add(inputChanged:Connect(function (input)
|
||||||
if input.UserInputType == mouseMovement then
|
if input.UserInputType == mouseMovement then
|
||||||
local position = input.Position;
|
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));
|
self:update(lastX + (downX - x),lastY + (downY - y));
|
||||||
upX,upY = x,y;
|
upX,upY = x,y;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue