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

Improvements to brace #237

Merged
merged 6 commits into from
Oct 2, 2023
Merged

Improvements to brace #237

merged 6 commits into from
Oct 2, 2023

Conversation

RubixDev
Copy link
Contributor

@RubixDev RubixDev commented Oct 1, 2023

This PR adds a new style key called outer-pointiness for the braces from the decorations library. It effectively controls the same thing as the existing pointiness but for the outer points instead. This adds the two new debug points i and j (what was i before is now k). Setting this to 0 (as is the default) provides the same behaviour as before.

I also moved documentation of the style keys from the function's doc-comment to the manual.typ file just like the other elements do it.

Screenshot of the updated example:
image

I am also second guessing my choice from yesterday in #227 that a pointiness of 0 is the maximum. Intuitively I would expect 1 to be the max, but then again with the angles it makes sense to have 0deg as the max 🤷. If you think we should change this I could quickly edit this PR or create another one, but that would of course immediately break backwards compatibility with v0.1.2.


Also unrelated to the PR: I noticed the example code in the manual is justified which I think doesn't look good in code snippets. And the default font inside the example canvases is also monospace.

@RubixDev
Copy link
Contributor Author

RubixDev commented Oct 1, 2023

I also just noticed an issue with the flip toggle: because internally it just swaps the start and end positions the final move-to(end) call then actually moves to the start position, which is not what users expect. I pushed a quick fix that the move-to checks for the flip value.

@RubixDev
Copy link
Contributor Author

RubixDev commented Oct 1, 2023

I pushed a quick fix that the move-to checks for the flip value.

Actually that's still not perfect when used as part of a merge-path. I'll work on a better fix in a bit.

@RubixDev RubixDev changed the title Add outer-pointiness style key for braces Improvements to brace Oct 1, 2023
@RubixDev
Copy link
Contributor Author

RubixDev commented Oct 1, 2023

Actually that's still not perfect when used as part of a merge-path.

Ok that's resolved. Flipping now works by negating the amplitude and pointiness values, which doesn't have these issues.

Additionally I improved the assertion messages and added a debug-text-size style option, so this PR is now just general polishing of yesterdays work in #227.

Copy link
Member

@johannes-wolf johannes-wolf left a comment

Choose a reason for hiding this comment

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

LGTM.

@johannes-wolf johannes-wolf merged commit 51fa85f into cetz-package:master Oct 2, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants