ManimCommunity / ManimCommunity/manim

OpenGL `stroke_width` is a 2D array, whereas it is a float in cairo.

Open
#2,443 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue:bug opengl
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

The following code is an example of a scene someone might run, with a direct modification to the `stroke_width` parameter.
```py
class a(Scene):
def construct(self):
number_plane = NumberPlane()
number_plane.stroke_width = 4

self.play(FadeIn(number_plane))
self.interactive_embed()
```

This would not work in `OpenGL` since `stroke_width` is a `_Data()` attribute and is a `2D` array.

`number_plane.stroke_width = [[4]]`

This is an issue as sensible code might break under `renderer=opengl`.

Relatively simple fix, make `stroke_width` a decarator.

## Expected behavior

No difference between `opengl` and `cairo` mobs.

## Additional comments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing how stroke_width is represented and assigned in the OpenGL and cairo renderers, using the NumberPlane example as the reproduction case. Confirm that assigning a float behaves consistently in both renderers, then verify the example no longer requires a 2D array for OpenGL.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.