Skip to content

Conversation

@Nikhil172913832
Copy link
Contributor

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

@Nikhil172913832
Copy link
Contributor Author

Hey @henrikmidtiby, just wanted to check if you could take a look at this PR when you get a chance.

@henrikmidtiby henrikmidtiby changed the title Fix: Correct portrait orientation bug in manim init project --default Fix: Correct resolution tuple order to (height, width) Oct 24, 2025
@henrikmidtiby henrikmidtiby enabled auto-merge (squash) October 24, 2025 12:58
@henrikmidtiby henrikmidtiby self-requested a review October 24, 2025 12:58
Copy link
Contributor

@henrikmidtiby henrikmidtiby 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 for the PR.
Looks good to me.

@github-project-automation github-project-automation bot moved this from 🆕 New to 👍 To be merged in Dev Board Oct 24, 2025
@henrikmidtiby henrikmidtiby added the pr:easy review There is nothing particular (i.e, it's about a general/small thing) to know for review! label Oct 24, 2025
@henrikmidtiby henrikmidtiby merged commit 7ffdf04 into ManimCommunity:main Oct 24, 2025
21 checks passed
@github-project-automation github-project-automation bot moved this from 👍 To be merged to ✅ Done in Dev Board Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:easy review There is nothing particular (i.e, it's about a general/small thing) to know for review!

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ManimCE 0.19.0 - corrupted settings after manim init

2 participants