Skip to content

Conversation

federicoviscomi
Copy link
Contributor

PR for #9694

Copy link
Collaborator

@felixpalmer felixpalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature, thanks for the contribution. The PR could just benefit from some render tests. Otherwise I would be happy to merge it.

You can add tests here, and then generate the new golden images by uncommenting this line and running yarn test browser

@federicoviscomi
Copy link
Contributor Author

I added tests to cover the new sizeBasis property. Any feedback is appreciated

data: points,
iconAtlas: './test/data/rectangle.png',
iconMapping: {
rectangle: {
Copy link
Collaborator

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.

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},
Copy link
Collaborator

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

Copy link
Contributor Author

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!

@coveralls
Copy link

coveralls commented Sep 30, 2025

Coverage Status

coverage: 91.135% (+0.001%) from 91.134%
when pulling 0ecfaa7 on federicoviscomi:icon-layer-size
into b74e383 on visgl:master.

Copy link
Collaborator

@felixpalmer felixpalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition, thanks!

@felixpalmer felixpalmer merged commit e48877d into visgl:master Oct 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants