Render major grid over main grid with thicker lines #3032
Closed
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.
This patch should be mostly considered as a feature request and proposal. Because it doesn't feel right for me and I don't really know how to improve it. Although we use this for a while and it fits our needs perfectly.
The thing we need is a second grid over the main grid to see major cells. We call them sectors. There is a fine grid setting in Preferences but I'm honestly tried to find its meaning and found nothing except "Snapping to Fine Grid". So my first idea is to use this value to draw a "major" grid over the main grid. There is "main grid" and "fine grid" why not draw them both? (similar to #368?)
I'm almost sure this is a valid topic for discussion on the forum yet I wanted to show how it affects the current codebase. Because at this point things come a little bit dirty for my taste.
MapRenderer
has methoddrawGrid
which defined asThe only "visual" option here is
gridColor
which seems fine. But when I add another one likeint gridFine
it doesn't look well. Because probably now it would be better to addfineGridColor
as well. At this point, I started to think maybe it is better to pass drawing options to the*Render
constructors but not into methods directly. But this looks like massive structural changes for the minor feature.So I kept things as simple as I could.
Added
gridFine
- new argument todrawGrid
method in MapRenderer. FordrawGrid
this value acts in sense of "major ticks". WhengridFine
set to non-zero value Orthogonal and Isometric renderers will draw thicker lines with this step.HexagonalRenderer does not support this because it's unclear what exactly we need to render here as the fine grid.
Some screenshots
Update
I reread the thread in referenced issue and tried to add 'Major Grid' setting. See the second commit.