Skip to content

Conversation

Nikhil172913832
Copy link

Overview: What does this pull request change?

Fixes the configuration file generated by manim init project --default to use correct landscape orientation (854×480) instead of portrait (480×854).

Motivation and Explanation: Why and how do your changes improve the library?

Closes #4184

When running manim init project --default my-project, the generated manim.cfg file had incorrect pixel dimensions that resulted in a portrait orientation (480×854) instead of the expected landscape orientation (854×480). This caused distorted rendering with scenes appearing compressed horizontally.

Root cause: Two bugs in /manim/cli/init/commands.py:

  1. CFG_DEFAULTS["resolution"] was set to (854, 480) in (width, height) order, inconsistent with select_resolution() which returns tuples in (height, width) order
  2. update_cfg() function was incorrectly assigning value[0] to pixel_width and value[1] to pixel_height, causing the values to be swapped

Fix:

  • Changed CFG_DEFAULTS["resolution"] from (854, 480) to (480, 854) to match the (height, width) convention
  • Fixed update_cfg() to correctly assign value[0] (height) to pixel_height and value[1] (width) to pixel_width

Now the generated config correctly produces landscape orientation matching Manim's default coordinate system.

Links to added or changed documentation pages

N/A - This is a bugfix with no documentation changes needed.

Further Information and Comments

Testing:

  • Existing test test_manim_init_project passes ✅
  • Manual verification: manim init project --default testproject now generates correct config with pixel_width=854, pixel_height=480

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

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

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

ManimCE 0.19.0 - corrupted settings after manim init

1 participant