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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egouge I'm not sure what this if-Statement is for because in the else-block the first inner statement (l2 == null) looks pretty identical to the inner statement of that if.
Question : What's the reason/use-case that
String[] text
can have length of 1 or the length of two? I thought that a LegendEntry represents one line in the Legend with ImageDescriptor and text element. My understanding is that every entry should have a LegentEntry representation after iterations. The if-Statement looks like only for the last one merge the text of the previous and the current and make a new Entry out of it. Why has the last Entry an array lenght for text of two while all others have a lenght of one. What I did not understand?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: What's the reason/use-case that String[] text can have length of 1 or the length of two?
A: From what I remember - it was the only way I could "easily" get "gradient" styles to appear in the correctly without substantially rewriting other parts of the Legend Graphic.
In the case shown above there are four labels (0, 3, 6, 8) but in terms of the colors (and legend entries) there are only three: white to light green [0-3]; light green to medium green [3-6]; and medium green to dark green [6,8]. So in order to get all the labels to show up one of those three legend entries needed to have two labels.
I am sure there were other ways of doing this, but this is what I came up with at the time.