-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Icon layer size #9736
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
Icon layer size #9736
Conversation
…ious size properties
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 added tests to cover the new sizeBasis property. Any feedback is appreciated |
test/render/test-cases/icon-layer.js
Outdated
data: points, | ||
iconAtlas: './test/data/rectangle.png', | ||
iconMapping: { | ||
rectangle: { |
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.
As is, the test doesn't prove much as you only have a single image. It could be made to pass even without the fix this PR adds just by adjusting the size
It would be better if your test image atlas had 4 road signs like you had in your issue which have different heights and the output would then show that they are all indeed the same width.
test/render/test-cases/icon-layer.js
Outdated
iconMapping: { | ||
tall: {x: 0, y: 0, width: 40, height: 80, mask: true, anchorY: 40}, | ||
wide: {x: 40, y: 0, width: 80, height: 40, mask: true, anchorY: 20}, | ||
square: {x: 120, y: 0, width: 60, height: 60, mask: true, anchorY: 30}, |
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.
Any reason you have mask: true
? I would remove it
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.
Good catch, mask was not needed. I have removed it and updated the golden image so the tests should pass now. Thanks!
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.
Great addition, thanks!
PR for #9694