function PetSrollingFrame.SetPetCanvasSize(O,b,Q)local o=b.UIGridLayout TradeMenuUI.Size=UDim2.new(.55,0,.925,0)local w,K,I=getPetSizes()local J=b.AbsoluteSize local a=w*J a=UDim2.new(0,a.X,0,a.Y)local f=K*J f=UDim2.new(0,f.X,0,f.Y)o.CellPadding=a o.CellSize=f local r=b:GetChildren()local F=0 if Q==true then for b,Q in pairs(b:GetChildren())do if Q:IsA("\073\109\097\103\101\076\097\098\101\108")and Q:FindFirstChild("\068\097\116\097")then if Q.Visible==true then F=F+1 end end end else F=#r-1 end local N=b.AbsoluteSize.Y local n=o.CellSize.Y.Offset local i=o.CellPadding.Y.Offset o.FillDirectionMaxCells=I local g=math.ceil(F/o.FillDirectionMaxCells)local Y=g*n+(g-1)*i b.CanvasSize=UDim2.new(0,0,0,Y+5)if TradeMenuUI.Visible==false then TradeMenuUI.Size=UDim2.new(0,0,0,0)end end return PetSrollingFrame
-- Set Pet Canvas Size --
function PetSrollingFrame:SetPetCanvasSize(Frame, searchOn)
	local UIGridLayout2 = Frame.UIGridLayout

	TradeMenuUI.Size = UDim2.new(0.55, 0, 0.925, 0)

	local PADDING, SIZE, MaxCells = getPetSizes()
	local AbsoluteSize = Frame.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)

	UIGridLayout2.CellPadding = NewPadding
	UIGridLayout2.CellSize = NewSize

	local children = Frame:GetChildren()
	local items = 0
	if searchOn == true then
		for _, v in pairs(Frame:GetChildren()) do
			if v:IsA("ImageLabel") and v:FindFirstChild("Data") then
				if v.Visible == true then
					items = items + 1
				end
			end
		end
	else
		items = #children - 1
	end
	local frameSizeY = Frame.AbsoluteSize.Y
	local ySize = UIGridLayout2.CellSize.Y.Offset
	local yPadding = UIGridLayout2.CellPadding.Y.Offset
	UIGridLayout2.FillDirectionMaxCells = MaxCells
	local rows = math.ceil(items / UIGridLayout2.FillDirectionMaxCells)
	local pixels = rows * ySize + (rows - 1) * yPadding
	Frame.CanvasSize = UDim2.new(0, 0, 0, (pixels + 5))

	if TradeMenuUI.Visible == false then
		TradeMenuUI.Size = UDim2.new(0, 0, 0, 0)
	end
end

return PetSrollingFrame
