Two 45' boats sailing downwind in 10-12kn breeze approaching downwind mark, not in zone, but close to it. Boat A is on port tack, running with chute up, heading directly at the mark. Boat A is slightly ahead and 3-4 boat lengths to leward of B.
Boat B is on starboard tack, broad reaching but with no chute. B is headed more or less in the direction of A, not directly at the mark. The courses of the two boats bring them close together. A is turning down, away from the mark, to give B right of way. B, at the last second, and inches from A, gybes to avoid collision. B protests A. A does penalty turn.
Did A have right of way in the situation described above, or are there other rules that apply.