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

Fix for mindmap connection bar glitches #892

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piannucci
Copy link

@piannucci piannucci commented Jul 1, 2020

When the distance between two concepts is at least half the sum of the concepts' radii, the connection bar is constructed as expected with initial, bar, and final portions. There is a visual glitch due to abutting filled path segments on certain anti-aliasing PDF rasterizers, including the one built into macOS, but that could be excused because the apparent gap is truly zero-width and a (sane) printer driver would not produce a white line. However, there is a more serious visual glitch when the distance between two concepts is less than the sum of the concepts' radii. In that case, the connection bar path becomes self-intersecting, and the even-odd inclusion test results in unfilled wedges.

This patch unifies the three path segments (initial, bar, and final) into a single continuous filled path segment. It alters the logic which computes the length of the initial and final flares, proportionally reducing them from their nominal values (of one-half the abutted circle radius) in the case where the distance between concept circles would be too small to fit this shape.

Before:
before

After:
after

As an added bonus, this patch also eliminates the onscreen glitch on anti-aliasing rasterizers.

Copy link
Member

@hmenke hmenke left a comment

Choose a reason for hiding this comment

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

I haven't reviewed this in too much detail yet, but at first sight this definitely needs some more work.

@ilayn
Copy link
Member

ilayn commented Jul 1, 2020

Also how does this behave for gradient linkages such as the ones given just before section 60.4 in the manual?

@piannucci
Copy link
Author

piannucci commented Jul 3, 2020

I've rewritten the patch so that it does not introduce any new parameters. I've also tried to do a better job of understanding TeX's scoping rules; I think this patch should be more robust.

Some things are still baffling to me: why does \pgfmathdivide@ consistently return 1.0 if the calls to \pgf@sys@tonumber are inline in the parameters, rather than edef'd first?

@piannucci
Copy link
Author

@ilayn It seems to work fine.

@hmenke
Copy link
Member

hmenke commented Jul 3, 2020

pgfmath uses the same registers internally.

\let\pgfmath@x\pgf@x
\let\pgfmath@xa\pgf@xa
\let\pgfmath@xb\pgf@xb
\let\pgfmath@xc\pgf@xc
\let\pgfmath@y\pgf@y
\let\pgfmath@ya\pgf@ya
\let\pgfmath@yb\pgf@yb
\let\pgfmath@yc\pgf@yc

concepts is less than half the sum of the concepts' radii.
@piannucci
Copy link
Author

Temporary variable names changed to something unique.

@piannucci piannucci requested a review from hmenke July 7, 2020 13:30
@hmenke hmenke added this to the 3.1.7 milestone Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants