-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a bug with polygon stroke styles. #700
Conversation
If a polygon has a hole, then stroke styles were misapplied to polygons. This was caused by there being more than one stroke per polygon and the stroke styles being called with polygon indices. Fixes #699.
Codecov Report
@@ Coverage Diff @@
## master #700 +/- ##
==========================================
+ Coverage 95.25% 95.28% +0.02%
==========================================
Files 83 83
Lines 8985 8990 +5
==========================================
+ Hits 8559 8566 +7
+ Misses 426 424 -2
Continue to review full report at Codecov.
|
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.
Just has one minor comment but other than that it looks good to me. It would be good if matthew or @jbeezley can confirm it fixes the issue.
* | ||
* @param {(object|function)?} styleValue The polygon's style value used for | ||
* the stroke. This should be m_this.style(<name of style>) and not | ||
* m_this.style.get(<name of style>), as the result is more efficient if |
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.
I have a feeling that this comment can be made more readable. Also when we refer to get, are we talking about Map.prototype.get()?
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.
Our style function can either be called like style('strokeColor')
, which returns the value set for strokeColor, or as style.get('strokeColor')
, which always returns a function for strokeColor. Here, if we know that the value is not a function, then we can pass it along to the stroke, whereas if it is a function, we have to get the appropriate value for the polygon by calling that function with the polygon's values.
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.
I can confirm that it fixes the issue. Thanks @manthey.
If a polygon has a hole, then stroke styles were misapplied to polygons. This was caused by there being more than one stroke per polygon and the stroke styles being called with polygon indices.
Fixes #699.