Description
Description of bug / unexpected behavior
When using the method scale(k, scale_stroke=True)
on a VGroup
, the submobjects stroke_width
are all set to the one of the VGroup
(default 4
) and then rescaled, even if they were having different stroke_width
before.
Expected behavior
When applying the method scale(k, scale_stroke=True)
to a VGroup
, the submobjects should have their stroke_width
rescale proportionally to their initial individual stroke_width
. Especially, scale(1.0, scale_stroke=True)
shouldn't change the submobjects (see code example)
How to reproduce the issue
See code example.
Code for reproducing the problem
from manim import *
class TestScene(Scene):
def construct(self):
dot = Dot(radius=1)
line = Line(ORIGIN, 2*DOWN, stroke_width=200)
self.play(FadeIn(dot, line))
self.wait(1)
self.play(line.animate.scale(1, scale_stroke=True).set_color(RED))
self.wait(1)
self.play(VGroup(dot, line).animate.scale(1, scale_stroke=True).set_color(BLUE))
self.wait(1)
System specifications
System Details
Environment is the official Manim docker image used as a devcontainer on MacOS 15.4.1 (Sequoia)
Additional comments
When calling scale(k, scale_stroke=True)
the method scale
calls the method set_stroke
with the value abs(scale_factor) * self.get_stroke_width()
computed on the current MObject (the VGroup
).
manim/manim/mobject/types/vectorized_mobject.py
Lines 524 to 531 in f304bd9
But because the current MObject is a VGroup
, this value is then propagated to all submobjects:
manim/manim/mobject/types/vectorized_mobject.py
Lines 331 to 333 in f304bd9
Metadata
Metadata
Assignees
Labels
Type
Projects
Status