Skip to content

Fix creation or animation of a zero-length DashedLine#4606

Merged
behackl merged 2 commits intoManimCommunity:mainfrom
SORVER:fix-dashs-zero
Feb 22, 2026
Merged

Fix creation or animation of a zero-length DashedLine#4606
behackl merged 2 commits intoManimCommunity:mainfrom
SORVER:fix-dashs-zero

Conversation

@SORVER
Copy link
Contributor

@SORVER SORVER commented Feb 21, 2026

Overview

Fix crash when creating or animating a zero-length DashedLine (start == end).
Issue: #4591

Motivation

DashedLine(ORIGIN, ORIGIN) or converting a line to zero-length caused IndexError because pop_tips() always called put_start_and_end_on, breaking the points array.

Fix: Only call put_start_and_end_on when tips are actually removed.

Changed Files

  • manim/mobject/geometry/arc.py – guard added in pop_tips()
  • tests/module/mobject/types/vectorized_mobject/test_dashed_vmobject.py – added regression tests

Checklist

  • PR title is clear and labeled
  • New functions/classes have docstrings if needed
  • Changes are covered by tests

@SORVER SORVER changed the title fixing #4591 Fix: Fix when creating or animating a zero-length DashedLine #4591 Feb 21, 2026
@behackl behackl changed the title Fix: Fix when creating or animating a zero-length DashedLine #4591 Fix creation or animation of a zero-length DashedLine Feb 22, 2026
@behackl behackl added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Feb 22, 2026
Copy link
Member

@behackl behackl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution! LGTM.

@behackl behackl merged commit e34e707 into ManimCommunity:main Feb 22, 2026
15 checks passed
@SORVER
Copy link
Contributor Author

SORVER commented Feb 27, 2026

@behackl , You're welcome!
Thanks for reviewing too.

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

Labels

pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants