pgf icon indicating copy to clipboard operation
pgf copied to clipboard

Fix foreach not remembering nodes between iterations

Open loopspace opened this issue 1 year ago • 1 comments

Motivation for this change

Fixes #1303 by remembering the last node between iterations of a foreach loop on a path.

Checklist

Please signoff your commits to explicitly state your agreement to the Developer Certificate of Origin. If that is not possible you may check the boxes below instead:

  • [X] Code changes are licensed under GPLv2 + LPPLv1.3c
  • [X] Documentation changes are licensed under FDLv1.2

loopspace avatar Jan 08 '24 21:01 loopspace

(Still a bit new to contributing to a Big Project ...)

The latest commit adds what I think is a more flexible approach to saving and restoring these macros and dimensions, which I've then extended to include \tikztostart (for to paths) and \tikz@tangent. There may be other macros and dimensions that need to be added but with this code that will be much easier to do.

My naming convention might not quite fit with the PGF ethos ... happy to change if so.

loopspace avatar Jan 09 '24 21:01 loopspace

Fixes https://github.com/pgf-tikz/pgf/issues/356 Fixes https://github.com/pgf-tikz/pgf/issues/1047 Fixes https://github.com/pgf-tikz/pgf/issues/1303 Fixes https://github.com/pgf-tikz/pgf/issues/1313

hmenke avatar Mar 27 '24 08:03 hmenke

That sounds do-able, I would be inclined to keep the current methods and simply wrap them in keys, then the lower-level methods are available to library authors.

I'll also implement the other things you pointed out.

loopspace avatar Apr 01 '24 18:04 loopspace

In trying to retrospectively sign my commits, I think I messed up the version history. I'll create a fresh branch of the current pgf repo and re-implement my patch, then resubmit it.

loopspace avatar Apr 03 '24 06:04 loopspace

I'll create a fresh branch of the current pgf repo and re-implement my patch, then resubmit it.

Or you can force push to fixforeach branch.

muzimuzhi avatar Apr 03 '24 14:04 muzimuzhi

I'll create a fresh branch of the current pgf repo and re-implement my patch, then resubmit it.

Or you can force push to fixforeach branch.

I did that, but then it's listing a whole slew of commits from the original as if they were fresh commits on this branch. Maybe that's not a problem and that when it's merged into the main branch then those will all get recognised as being the same commits as the original ones. I just don't know!

Well, let me say that I'm quite happy to create a fresh branch and add in my changes, signing them properly this time - if it's needed.

But I guess the most important thing first is to make sure the code is right and worry about the version structure afterwards.

loopspace avatar Apr 03 '24 22:04 loopspace

I did that, but then it's listing a whole slew of commits from the original as if they were fresh commits on this branch.

Err GitHub thinks all commits merged by https://github.com/loopspace/pgf/commit/f2fa2e44098e049323b5320de99d0027b81ca59e were authored by original authors but committed by you. Not sure if that's normal behavior of a merge commit.

muzimuzhi avatar Apr 04 '24 22:04 muzimuzhi

I've made a new branch with the code changes where I've signed-off my commit from the outset. I'll close this pull request and open a new one from that branch, hopefully that won't have all the weird merges.

loopspace avatar Apr 12 '24 20:04 loopspace

New pull request: https://github.com/pgf-tikz/pgf/pull/1316

loopspace avatar Apr 12 '24 20:04 loopspace