manim icon indicating copy to clipboard operation
manim copied to clipboard

`to_edge` doesn't seem to respect my `--resolution` flags

Open anandijain opened this issue 6 months ago • 2 comments

I'm just learning manim (0.18, windows, python 3.11.7) but having some trouble with vertical aspect ratios (w1080xh1920). it doesn't seem like to_edge is respecting my --resolution flags. its possible i am misunderstanding the docs and what to_edge does

from manim import *

class TopTextExample(Scene):
    def construct(self):
        my_text = Text("Hello, Manim!")
        my_text.to_edge(UP)
        self.add(my_text)
        self.wait(2)

manim -ql .\test.py gives me text that is actually at the top of the rendered (horizontal) video

but manim -ql --resolution 1080,1920 .\test.py gives the attached image where the text is considerably lower than the top edge Screenshot 2024-01-30 095222

any help would be appreciated!

anandijain avatar Jan 30 '24 15:01 anandijain

printing out config for manim --resolution 1080,1920 .\test.py, i'm seeing:

pixel_height: 1920, pixel_width: 1080 and frame_height: 8.0, frame_rate: 60.0, frame_width: 14.222222222222221

i was able to get everything working by manually swapping the values for frame_height and frame_width in the config.

anandijain avatar Jan 30 '24 15:01 anandijain

see also my answer to your question in Discord...

uwezi avatar Jan 30 '24 17:01 uwezi