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

@piannucci piannucci commented Jul 1, 2020

Copy link
Copy Markdown

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.

@hmenke hmenke left a comment

Copy link
Copy Markdown
Member

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

ilayn commented Jul 1, 2020

Copy link
Copy Markdown
Member

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

@piannucci

piannucci commented Jul 3, 2020

Copy link
Copy Markdown
Author

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

hmenke commented Jul 3, 2020

Copy link
Copy Markdown
Member

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
@hmenke

hmenke commented Jun 16, 2026

Copy link
Copy Markdown
Member

On 2026-06-15 a more comprehensive testsuite was introduced for PGF/TikZ. This tests all new contributions against the examples extracted from the manual and checks whether anything has changed to avoid regressions. Since this pull request was opened before that, these tests were not run automatically. I have run l3build check on the result of the merge of this pull request branch into master. The result can be found below.

Tip

Your pull request might have failed some tests. This does not mean that your contribution will be rejected. In fact, depending on the changes you propose, it might even be expected that some tests fail, however, this needs to be evaluated carefully.

Failed tests
  • pdftex
    • config-examples
      • pgfmanual-en-library-mindmaps
      • pgfmanual-en-tutorial-map
  • latexdvips
    • config-examples
      • pgfmanual-en-library-mindmaps
      • pgfmanual-en-tutorial-map
  • latexdvisvgm
    • config-examples
      • pgfmanual-en-library-mindmaps
      • pgfmanual-en-tutorial-map
  • luatex
    • config-examples
      • pgfmanual-en-library-mindmaps
      • pgfmanual-en-tutorial-map
  • xetex
    • config-examples
      • pgfmanual-en-library-mindmaps
      • pgfmanual-en-tutorial-map

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