ManimCommunity / ManimCommunity/manim

ReplacementTransform not working properly with add function

Open
#2,507 3 comments 0 reactions 0 assignees View on GitHub
issue:bug
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

The first text does not disappear and after the and it suddenly disappears and doubled.

## Expected behavior

We expected that the first text disapear and replaced by the second text. When move the square the second text move as well.

## How to reproduce the issue

Code for reproducing the problem

```py
square=Square(side_length=1)

tex=Tex("$\\sqrt{2}+1$")

tex2=Tex("$\\frac{x}{\\sqrt{2}}$")

square.add(tex)

self.play(Write(square))

self.play(ReplacementTransform(tex,tex2),run_time=2)

self.play(ApplyMethod(square.shift,UP*2))
```

## Additional media files

Images/GIFs

![ArrayMain_ManimCE_v0 14 0](https://user-images.githubusercontent.com/3748059/151611852-63245cc6-1464-4f84-8a0c-aefafbb3edc3.gif)

Contributor guide

Open the contributing guide

Research direction

Start by running the provided reproduction using Square.add, ReplacementTransform, and ApplyMethod to observe when the first text disappears and whether the replacement moves with the square. Trace those named animation operations and verify that the first text is replaced once and the second text remains attached when the square shifts.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.