Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "2D API functions on map now take point objects rather than x, y coordinates"
Purpose of change
My ongoing campaign to make more use of
point
andtripoint
for improved type safety and code clarity.Describe the solution
Convert member functions of
map
, and the functions indrawing_primitives.h
, to usepoint
andtripoint
rather than individualint
coordinates.I'm not sure I caught every relevant function in those places, but I changed most of them.
Perform associated refactoring around calls to and implementations of these functions.
This is a fairly massive change. But as usual most of these changes were automated, so hopefully the chance of introducing a bug is small.
I think
map
has the most of these types of functions (relative to other classes). Hopefully this refactoring effort gets easier from here...Describe alternatives you've considered
We ultimately want to get rid of many of these functions entirely, I think, in favour of the 3D overloads taking tripoints. But I think it makes sense to use this as a step in that direction, rather than avoiding it because we want to make a different change in the long term.
For example, after these changes, many of the calls to these functions can be switched to the 3D overloads simply by removing
.xy()
(whether it would be correct to do so is an entirely different question, of course).Additional context
In support of #32017.