Skip to content

Minor issue related to rotate method. #2451

@SalekDev

Description

@SalekDev

I just wanted to comment on a minor issue I just ran into while using the rotate() method of mobjects. I understand the reason why apply_points_function() in rotate() by default has the option works_on_bounding_box=False. This is because rotation with respect to an object's center does not alter it's fixed hitbox. However it leads to some funny issues when you don't update the hitbox and the rotation is not with respect to the object's own center. Maybe the method should include some logic to automatically determine if the bounding box should be updated?
In my case I needed to keep track of the center of an object that was rotating with respect to the origin and do some operations with that position vector through an updater function. Since it calculates the center of an object through the hitbox the calculated center was always the initial position despite the object rotating. Then I realized I had to pass works_on_bounding_box=True so that it updates. It is not that big of a deal but I can see it leading to some annoying head scratcher moments for manim newbies like myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions