Skip to content

Conversation

PatrickMcClusky
Copy link

Overview: What does this pull request change?

This PR attempts to fix the issue #4097, where the OpenGL renderer fails due to an infinite nesting of the stroke_width value inside of NumPy arrays.

Motivation and Explanation: Why and how do your changes improve the library?

When rendering certain VMObjects using the OpenGL renderer, the stroke_width attribute was repeatedly wrapped into 2 additional NumPy arrays on each update. This resulted in once it was nested into 64 NumPy arrays the renderer failed.

This PR resolves the issue by ensuring that the stroke value is only placed into a NumPy array if it is not already one. This prevents excessive nesting and ensures consistent behavior between the OpenGL and Cairo renderers.

Further Information and Comments

This fix is minimal and self-contained, targeting only the stroke_width logic.

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

2 participants