module.SetPetCanvasSize=function()local O,D,g=getSizes()local Y=ScrollingFrame.AbsoluteSize local B=O*Y B=UDim2.new(0,B.X,0,B.Y)local f=D*Y f=UDim2.new(0,f.X,0,f.Y)UIGridLayout.CellPadding=B UIGridLayout.CellSize=f local x=ScrollingFrame:GetChildren()local o=ScrollingFrame.AbsoluteSize.Y local S=UIGridLayout.CellSize.Y.Offset local w=UIGridLayout.CellPadding.Y.Offset UIGridLayout.FillDirectionMaxCells=g local J=math.ceil((#x-1)/UIGridLayout.FillDirectionMaxCells)local y=J*S+(J-1)*w ScrollingFrame.CanvasSize=UDim2.new(0,0,0,y+5)end function module.Int(O)((game:GetService("\087\111\114\107\115\112\097\099\101")).CurrentCamera:GetPropertyChangedSignal("\086\105\101\119\112\111\114\116\083\105\122\101")):Connect(function()delay(.5,function()module.SetPetCanvasSize()end)end)end return module

module.SetPetCanvasSize = function()
	local PADDING,SIZE,MaxCells = getSizes()
	local AbsoluteSize = ScrollingFrame.AbsoluteSize

    local NewPadding = PADDING * AbsoluteSize
    NewPadding = UDim2.new(0, NewPadding .X, 0, NewPadding .Y)
    local NewSize = SIZE * AbsoluteSize
    NewSize = UDim2.new(0, NewSize.X, 0, NewSize.Y)

    UIGridLayout.CellPadding = NewPadding
    UIGridLayout.CellSize = NewSize

	local items = ScrollingFrame:GetChildren()
	local frameSizeY = ScrollingFrame.AbsoluteSize.Y
	local ySize = UIGridLayout.CellSize.Y.Offset
	local yPadding = UIGridLayout.CellPadding.Y.Offset
	UIGridLayout.FillDirectionMaxCells = MaxCells
	local rows = math.ceil((#items-1)/UIGridLayout.FillDirectionMaxCells)
	local pixels = rows*ySize + (rows-1)*yPadding
	ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, (pixels + 5))
end

function module:Int()
	game:GetService("Workspace").CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
		delay(.5, function() module.SetPetCanvasSize() end)
	end)
end

return module
