Rusty swings, leaking water fountains, broken equipment and graffiti have long been problems for the San Francisco Recreation and Park Department.

But there’s never enough money to fix it all. Funding for the department has dropped by nearly half over the past 15 years, and investment in parks has not kept pace with the city’s growing budget.

Proposition B is a set-aside that would help the department tackle deferred maintenance by infusing more than $1 billion into parks over the next 30 years. Opponents counter it would take away general fund money that could be used for vital city services like public health and safety.

The measure, which is on the June 7 ballot, would draw an annual increase of $3 million for park repairs over the first 10 years. After that, funding would parallel the city’s percentage revenue growth.

The charter amendment will call for parks to rely on a bigger portion of the general fund and will not ask for a tax increase. And if a budget deficit is expected, the allocation’s growth would be suspended for that year. Prop. B would also extend the Open Space Fund — a property tax set-aside passed in March 2000 — for an additional 15 years, through 2046.

“This is a generational ballot measure,” said Supervisor Mark Farrell, who introduced the legislation. “Parks are the jewels of our city, and we need to protect them. We’ve done this in a responsible manner where the money will grow over time. It’s making sure that, as the general fund grows, funding for parks doesn’t flatline.”

Funding for Park and Rec was slashed after the 2008 economic recession, which caused a downturn in the city budget. But even as San Francisco recovered, the baseline money for parks plateaued. Had the percentage of funding remained constant at 2.1 percent of the general fund, Park and Rec would be receiving $89 million this year, rather than $50 million, concluded a report by the San Francisco Parks Alliance, a nonprofit that supports the city’s parks.

“We are very vulnerable to the economy,” parks director Phil Ginsburg said. “Public safety and health and human services, they are locked in. When the economy tanks, we are fighting over potholes and trees as to what gets funded. This measure will provide us with stability, prevent the cuts we saw in 2009 and allow us to protect the investments we have made.”

The department has amassed a funding shortfall of about $40 million, the Parks Alliance report estimates. The biggest ramifications have been on maintenance — requests are filled nearly entirely on an emergency and individual basis. There’s also a backlog of more than 5,000 maintenance requests, which would cost $1.7 billion and take more than a year to address.

Prop. B would provide long-term fiscal stability and investment in parks, Farrell said. But there are points of contention, including the amount of money and how it would be spread among the city’s 220 parks. Some supervisors were slow to support the measure until it was adjusted to spread money equally across all parks and cross-city analysis metrics were put into place.

Critics also say the set-aside would earmark money that could otherwise go to vital city services. In a letter, city Controller Ben Rosenfield cautioned that the measure would take more discretionary revenues out of the budget over time and have a significant impact on the cost of government. Voter-adopted city policy tries to limit set-asides, he said.

“The last thing a legislator wants is to have his or her hands tied,” said retired Superior Court Judge Quentin Kopp, who is against the measure. “That’s what this does. It’s not in the general best interest of the people of San Francisco because their interests also include public health and other issues, which may one day be injured by the fact that there could be inadequate money to fund them during an emergency.”

It could also hurt the department’s chances at getting more money in the future during the city’s budgeting process, Kopp said, a former city supervisor.

The $3 million is only a sliver of the city’s $8 billion budget, said Matthew O’Grady, chief executive of the Parks Alliance. The measure would lock in a basic level of funding for the department, he said, calling it a “modest tweak” to take care of parks.

The department will never get a lion’s share during the budget process because there are a lot of priorities, Farrell said. Prop. B would lock in a basic funding source for parks, he said.

“As someone who has advocated every single year, we have moved the needle as much as we have been able to,” Farrell said. “What we have found is we continue to slip further and further behind. At the end of the day, I don’t want to see our parks continue to slip down.”

Lizzie Johnson is a San Francisco Chronicle staff writer. Email: ljohnson@sfchronicle.com Twitter: @LizzieJohnsonnn