Skip to content

_getElementRect returns an new object #611

Open
@gregmax17

Description

@gregmax17

I was doing some digging around the code and noticed the _getElementRect method returns a new object. For this particular method/instance, it runs this method EVERY frame the mouse/touch moves. This is poor practice, see the test here.

Creating some kind of static object like _lastElementRect with the properties top, left, right, and bottom and reseting those values every time the _getElementRect is called instead of the newly created object will help performance a lot.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions