Skip to content

CoreNode: Only create scaleRotateTransform matrix when needed #316

@frank-weindel

Description

@frank-weindel

On a CoreNode, if it's rotation prop is 0 and both it's scaleX and scaleY props are 1, there is no need to create a scaleRotateTransform. In updateLocalTransform we can check if the scaleRotateTransform exists, and if not, simply create the Local Transform without using it. The pivotX and pivotY properties can also be completely ignored in this case since they only apply during scaling/rotation.

Since likely most Nodes in applications will not be need scaling or rotation this should save some CPU bound memory per node while also cutting down on calculations done during the first update for Nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions