Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Implement head resizing (and reversal) for larrow/rarrow/darrow#29998
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
2f366fae8d7eb715bd7dc4f574955c3fa6080655490471e92212cbc9273a2febf2d06b0ea2f5ad7fd405ff34b4bd9b0b32f3369c03913ef663a4ba97ed9fd1d953aefd2105da54147e6b5ba28e976e54ba08c67b1dc613e73d95322b83affe94a77798d4bc42ac0bffa6e2abff8ba2497b4b3b1119a05180d1c40460306e201e62c94fa82dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2531,6 +2531,10 @@ def __init__(self, pad=0.3, head_width=1.5, head_angle=90.0): | ||
| # Set arrow-head angle to within [0, 360 deg) | ||
| self.head_angle = head_angle % 360. | ||
CharlieThornton33 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| if self.head_angle == 0: | ||
| # This would cause a division by zero ('infinitely long' arrow head) | ||
| raise ValueError("Head angle of zero is not valid.") | ||
| def __call__(self, x0, y0, width, height, mutation_size): | ||
| # scaled padding | ||
| pad = mutation_size * self.pad | ||
| @@ -2554,10 +2558,7 @@ def __call__(self, x0, y0, width, height, mutation_size): | ||
| # the total 'width' of arrow-head not within the body. | ||
| width_adjustment = (self.head_width - 1) * dx | ||
| if self.head_angle <= 180: | ||
| # Non-reversed arrow head (<---) | ||
| # tan(1/2 * angle subtended by arrow tip) | ||
| @@ -2659,7 +2660,9 @@ def __init__(self, pad=0.3, head_width=1.5, head_angle=90.0): | ||
| The amount of padding around the original box. | ||
| head_width : float, default: 1.5 | ||
| The width of each arrow head, relative to that of the arrow body. | ||
| Only positive valuesif self.head_angle == 0: | ||
| # This would cause a division by zero ('infinitely long' arrow head) | ||
| raise ValueError("Head angle of zero is not valid.") are accepted. | ||
CharlieThornton33 marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| head_angle : float, default: 90.0 | ||
| The angle subtended by the tip of each arrow head, in degrees. | ||
| Only nonzero angles are accepted. | ||
| @@ -2674,6 +2677,10 @@ def __init__(self, pad=0.3, head_width=1.5, head_angle=90.0): | ||
| # Set arrow-head angle to within [0, 360 deg) | ||
| self.head_angle = head_angle % 360. | ||
| if self.head_angle == 0: | ||
| # This would cause a division by zero ('infinitely long' arrow head) | ||
| raise ValueError("Head angle of zero is not valid.") | ||
| def __call__(self, x0, y0, width, height, mutation_size): | ||
| # scaled padding | ||
| pad = mutation_size * self.pad | ||
| @@ -2698,10 +2705,7 @@ def __call__(self, x0, y0, width, height, mutation_size): | ||
| # the total 'width' of arrow-head not within the body. | ||
| width_adjustment = (self.head_width - 1) * dx | ||
| if self.head_angle <= 180: | ||
| # Non-reversed arrow heads (<--->) | ||
| # tan(1/2 * angle subtended by arrow tip) | ||
Uh oh!
There was an error while loading.Please reload this page.