Skip to content

Fix for mindmap connection bar glitches#892

Open
piannucci wants to merge 1 commit into
pgf-tikz:masterfrom
piannucci:patch-1
Open

Fix for mindmap connection bar glitches#892
piannucci wants to merge 1 commit into
pgf-tikz:masterfrom
piannucci:patch-1

Conversation

@piannucci
Copy link
Copy Markdown

@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
Copy Markdown
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.

Comment thread tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex Outdated
Comment thread tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex Outdated
Comment thread tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex Outdated
Comment thread tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex Outdated
Comment thread tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex Outdated
@ilayn
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

@ilayn It seems to work fine.

@hmenke
Copy link
Copy Markdown
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

Comment thread tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex Outdated
concepts is less than half the sum of the concepts' radii.
@piannucci
Copy link
Copy Markdown
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