Skip to content
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

Make dedicated pill shape function #1069

Merged
merged 8 commits into from
May 22, 2024
Merged

Make dedicated pill shape function #1069

merged 8 commits into from
May 22, 2024

Conversation

ZeLonewolf
Copy link
Member

@ZeLonewolf ZeLonewolf commented May 18, 2024

This PR adds "pill" as a first-class shape that a shield style can specify. Behind the scenes in the shield library, it still just invoking roundedRectangle, but this allows the shield style definition to not have to do the hack of specifying a pill by declaring a rounded rectangle with a large radius. This removes the hack mentioned in #1062 for taginfo and saves a few bytes of ShieldJSON.

I anticipate doing the same job for circle and homePlate shapes.

@ZeLonewolf ZeLonewolf marked this pull request as ready for review May 18, 2024 02:36
@claysmalley claysmalley added enhancement New feature or request shield-generator Issues specific to the shield library labels May 18, 2024
Copy link
Member

@claysmalley claysmalley left a comment

Choose a reason for hiding this comment

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

I anticipate doing the same job for circle and homePlate shapes.

How come? Because they have different prettyShapeNames?

shieldlib/src/shield_canvas_draw.ts Outdated Show resolved Hide resolved
@ZeLonewolf
Copy link
Member Author

ZeLonewolf commented May 18, 2024

How come? Because they have different prettyShapeNames?

I think it's generally useful and more readable in the ShieldJSON to have the shield definition be able to specify common shapes by name, particularly when they can consume defaults (in this case, corner radii). I confess that I don't fully understand @1ec5's vision for shield definition re-usability, but I see value in a slightly richer dictionary of shield shapes being more extendable down the line.

@ZeLonewolf ZeLonewolf merged commit 9d05510 into main May 22, 2024
6 checks passed
@ZeLonewolf ZeLonewolf deleted the zlw-pill branch May 22, 2024 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shield-generator Issues specific to the shield library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants