Neither side threatened a great deal in a hard fought first half but Doncaster gradually got on top and dominated after the break.
Swindon keeper Wes Foderingham did well to save from Kyle Bennett and Jamie McCombe and defender Aden Flint survived a couple of penalty appeals after he had sent Dean Furman and Chris Brown tumbling in the area.
However, it was no more than Doncaster deserved when McCombe headed the winner from David Cotterill's 80th minute corner.
MacDonald reckons his team can still win promotion. He said: "We've got five games left and the aim is to win them all. Whether that will be enough to give us automatic promotion we'll have to wait and see but we are certainly capable of winning those games.
"Obviously we're disappointed with the result and the performance because we didn't play as well as we can do today. We didn't really get to grips with the game for whatever reason.
"I thought we might have got away with it and might even have pinched a win ourselves because we defended well but then we allowed their man a free header for the goal."
Rovers boss Brian Flynn said: "I thought we controlled the game and our keeper didn't really have a lot to do. It was a good performance and a very important victory and I'm pleased for the players and the fans.
"We are five points clear at the top before the rest of the teams play and I'm not really bothered about who is behind us so long as they stay there.
"We should have had a couple of penalties and won by more goals but thankfully it didn't matter in the end."
- Sports & Recreation
- Wes Foderingham
- Jamie McCombe
- David Cotterill
- Kyle Bennett