Skip to content

Baseline alignment issue of Code #4626

@ZhuChongjing

Description

@ZhuChongjing

Description of bug / unexpected behavior

When using Code, if I write pass, the code will move up a certain distance. But if I add a b at the end, it will return to normal. I wonder if Manim uses top alignment?

Expected behavior

I hope you can solve this fundamental problem. Otherwise, I will have to manually use the shift method to make adjustments.

How to reproduce the issue

Code for reproducing the problem

from manim import *

class CodeBug(Scene):
    def construct(self):
        code = Code(code_string="pass")
        code2 = Code(code_string="pass b")
        group = VGroup(code, code2).arrange(DOWN)
        self.add(group)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions