| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Including a test of updating an Arc would be better, but not going to block on that as this fixes 3 bugs and extends the test coverage as-is.
Sorry, something went wrong.
|
It seems like the added test also exercises the update-branch. Edit: no, it is not. |
Sorry, something went wrong.
|
This example fails without _update_path, so I will try to extract the relevant parts (probably it is enough to use units, although I do not really understand what changes the second time it is called...). https://matplotlib.org/devdocs/gallery/units/ellipse_with_units.html |
Sorry, something went wrong.
|
Finally! While fighting the unit system, I realized that I had reused private names... But it was just to change them and everything worked! Reading the Patch-code a bit better, I also was able to trigger updates without units. |
Sorry, something went wrong.
I lost a couple of hours to the exact same issue working on the svg font fallback! |
Sorry, something went wrong.
| def _update_path(self): | ||
| # Compute new values and update and set new _path if any value changed | ||
| stretched = self._theta_stretch() | ||
| if any(a != b for a, b in zip( |
There was a problem hiding this comment.
I think that's just
if stretched != (self._theta1, self._theta2, ...): ...as it's a tuple comparison?
Sorry, something went wrong.
| y = np.sin(theta) | ||
| stheta = np.rad2deg(np.arctan2(scale * y, x)) | ||
| # arctan2 has the range [-pi, pi], we expect [0, 2*pi] | ||
| return (stheta + 360) % 360 |
There was a problem hiding this comment.
As noted in https://github.com/matplotlib/matplotlib/pull/22678/files#r831735789 you can get rid of the +360.
Sorry, something went wrong.
There was a problem hiding this comment.
Minor nits, feel free to self-merge with or without fixing.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Now, the correct path is set for Arc which should solve the following.
I am still a bit doubtful if this will kill something else and so on, so I've not added tests yet. Also, not sure if this warrants a release note.
There is a bit of inefficiency in the implementation as there are basically two paths created: one during draw time and one that is just stored (and used for e.g. 3D, scaling and collections). One the other hand, for multiple draws there will not be a new creation of an Path.arc on every redraw.
PR Checklist
Tests and Styling
Documentation